Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 07-14-2005
AlexKom AlexKom is offline
Registered User
 
 
Join Date: Jul 2005
Location: Moskow
Posts: 18
Send a message via ICQ to AlexKom
-->
Newbie question about sending data

Good day, all!

I have one newbie question.
There is a task - to send a file (for example, any file in binary mode) from client to server.

How it can be done?
From where I must start to work?
What section of documentation can help me to solve this task?

Thanks a lot.
Alexander
Reply With Quote
  #2 (permalink)  
Old 07-14-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Hi,

Ice includes a service called IcePatch2 that allows you to efficiently replicate a directory hierarchy across a network. I recommend that you study the IcePatch2 sources (in src/IcePatch2) for a good example of how to efficiently transfer large amounts of data using Ice.

Take care,
- Mark
Reply With Quote
  #3 (permalink)  
Old 07-14-2005
AlexKom AlexKom is offline
Registered User
 
 
Join Date: Jul 2005
Location: Moskow
Posts: 18
Send a message via ICQ to AlexKom
-->
If i understood, IcePatch2 is using for sending data from server to client.
But in my case a one binary file from client to server must be sent.
How it can be realize?
Reply With Quote
  #4 (permalink)  
Old 07-14-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
You are correct that IcePatch2 transfers files from the server to a client, but the technique it uses to transfer the file is applicable regardless of the direction in which the file is sent.

Take care,
- Mark
Reply With Quote
  #5 (permalink)  
Old 07-14-2005
AlexKom AlexKom is offline
Registered User
 
 
Join Date: Jul 2005
Location: Moskow
Posts: 18
Send a message via ICQ to AlexKom
-->
Oh, ok. I will teach it tomorrow.

And my search in forum archive gave me next links:
How can I develop a File transfer application?question 1

What is better to use: sequence or IcePatch2? (i don't want to reinventing a wheel)
Reply With Quote
  #6 (permalink)  
Old 07-14-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
IcePatch2 probably isn't an appropriate solution if you are sending files from a client to a server. However, reading the IcePatch2 sources should be helpful as you implement your application.

Good luck,
- Mark
Reply With Quote
  #7 (permalink)  
Old 07-15-2005
AlexKom AlexKom is offline
Registered User
 
 
Join Date: Jul 2005
Location: Moskow
Posts: 18
Send a message via ICQ to AlexKom
-->
Ok, i will look it.
Thanks you, mes, for you answer.
Reply With Quote
  #8 (permalink)  
Old 07-17-2005
AlexKom AlexKom is offline
Registered User
 
 
Join Date: Jul 2005
Location: Moskow
Posts: 18
Send a message via ICQ to AlexKom
-->
I have one new question: can I call a function which realized on client without using some server part on a client side?

In detail: client call thrue proxy a function on server and give for him a proxy to function (ClientFunc* func) in parameter. After that server must call received function on client. Еhere is no need to use asynchronous working.

How it can be done?
Reply With Quote
  #9 (permalink)  
Old 07-17-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Yes, you can do this. The callback example in demo/Ice/callback demonstrates how to do this. Note that this example requires that the server establish a new connection back to the client. An alternative is to use a bidirectional connection, which is shown by the example in demo/Ice/bidir.

Good luck,
- Mark
Reply With Quote
  #10 (permalink)  
Old 07-17-2005
AlexKom AlexKom is offline
Registered User
 
 
Join Date: Jul 2005
Location: Moskow
Posts: 18
Send a message via ICQ to AlexKom
-->
Thanks, I must keep my eyes more openly.

Is every callback function must have void declaration?
Reply With Quote
  #11 (permalink)  
Old 07-17-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Quote:
Originally Posted by AlexKom
Is every callback function must have void declaration?
No, you can use any declaration you like if your callback is invoked as a twoway. However, if you want to invoke the callback as a oneway, then it must have a void return type and it must not have any out parameters.

- Mark
Reply With Quote
  #12 (permalink)  
Old 07-18-2005
AlexKom AlexKom is offline
Registered User
 
 
Join Date: Jul 2005
Location: Moskow
Posts: 18
Send a message via ICQ to AlexKom
-->
Ok, thats work excelent. I get a callback example and modify it a little. I get what i want.

Thanks a lot for your help, Mark!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
computation server (newbie question) rlimberger Help Center 1 02-21-2007 08:46 PM
Question about sending large data. JaneShang Help Center 3 10-14-2005 01:25 PM
A unsure question about getting data laotee Help Center 9 09-22-2005 12:00 PM
A question about getting data laotee Help Center 4 09-20-2005 09:29 AM
Ice newbie question ruzark Help Center 1 11-30-2004 03:11 PM


All times are GMT -4. The time now is 11:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.