Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Calling methods using sockets

Hii
I'm new to socket programming...I have to connect to the serversocket and
register with a program running on it...there will be multiple clients requesting for registration and other services...How can i call the methods..pass data to that program..Can anyone help me out?
[289 byte] By [udhu] at [2007-11-11 10:23:25]
# 1 Re: Calling methods using sockets
You could use SOAP to remotely call procedures from a server, but it sounds more like you're building a chat network and need authentication between client and server.

Once you establish a connection to the server, the client would send a packet with some data in it. The server parses this data and determines what the client is asking, it then responds.
Phaelax at 2007-11-11 22:31:31 >
# 2 Re: Calling methods using sockets
If both Client and Server are Java applications, then the simplest way would be using RMI .If the Server wants to multicast the messages, then RMI will not help you becuase RMI relies on clients server communication. There is an open source project from jgroups which help you to do the same.
http://www.jgroups.org/
sudheerprem at 2007-11-11 22:32:37 >
# 3 Re: Calling methods using sockets
Iam building a BitTorrent Client...i run each client at different machines and each client will need to interact with the tracker from time to time..How can this be accomplished?Both the client and tracker are java programs.
udhu at 2007-11-11 22:33:41 >
# 4 Re: Calling methods using sockets
Your client has to invoke the methods defined in server using RMI. It is easy to accomplish in RMI and you don't want to know about the underlying communication mechanism. Please refer RMI tutorail to do the same.
sudheerprem at 2007-11-11 22:34:36 >