Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,

Iam implementing a callback in client-server application using c# windows forms.

Here, the client needs to execute a server method. Then the server method should have any loop
iterating from 1 to 20 and should send status message to the client(something like value of iteration) for each iteration. I tried this using callbacks but failed.

Can any one suggest solution for this scenario.

Thanks in advance.

Pavan.
Posted

1 solution

AFAIK, you can't do that: you would have to implement a part of your communications which asked the server to "execute method X" - you can't execute a method on the server within the client, because they are separate processes with there own memory spaces and so forth, and may not even be on the same machine!
 
Share this answer
 
Comments
M J Pavan Kumar 21-Jun-14 2:20am    
HI,

Sorry, I do not mean that the client directly calls the method of server, instead I followed the rules of .Net framework for Remoting and got successful in communicating with server.

Here the requirement is to send status message for every iteration completion from server to the client, since my client will be disconnected if the server processes the request for more than 30 secs.(say Timeout as 30secs, server should execute a db query for each iteration).

Pavan.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900