PDA

Click to See Complete Forum and Search --> : sockets or remoting


akram
Apr 1st, 2005, 09:06 AM
Hello everyone,

I have to create a server-client application in VB.NET but do not know the best way to implement it.

I have a server with a predefined list of clients and their IPs. A VB application runs on every client machine, and every once in a while it checks the server for new updates that it uploads using ftp (an ftp server resides on the server). The server should also be able to invoke the function on the client that makes the upload.

I am unsure whether to use sockets to communicate between the client and the server or to use remote scripting/webservices. Since I already know the clients, isn't it too much of an overhead to use a socket listener and a client socket. On the other hand with remoting, the server might not be in full control of the communication and cannot really maintain the client states, i.e., if there is a connection loss, can the server easily detect it.

Any suggestions would really be appreciated, thank you.

Dave Sell
Apr 1st, 2005, 10:20 AM
If you use .NET Remoting, you could conceivably not have the Clients poll the server like that.

Instead, you could have the server notify the clients when something interesting happens.

akram
Apr 1st, 2005, 11:03 AM
yeah thats what i had in mind, but if the server invokes a method on the client like "ftp huge files (about 800 megs)", and if this method takes hours to complete, can the server track the client state, i.e if there is a connection loss, if the ftp failed, or if it completed.

thx

Dave Sell
Apr 2nd, 2005, 09:28 PM
Well that depends. I am a DCOM guy, just getting into .NET Remoting ala C#.

But if Remoting is like DCOM, then you have to look at it in 1 of 2 ways. In DCOM, either the server has an instance of the client, or the client has an instance of the server.

If the client has an instance of the server, then the server can Raise Events to the client (my favorite behavior).

If the server has an instance of the client, then yes, the server can totally track the state or status of the client, should the client expose its state or staus Publicly, via Function members, Properties, or Events.