How can I write code to start communication between two servers

I want to create two servers that will communicate to each other as well as a client which will communicate with both of them.Can any one please suggest me how to get started...


  • That totally depends on what you try to achieve. Are you writing the programs running on these servers yourself? Is it business critical?

    Suppose your applications are written in Java (not really needed, but makes things easier), and the data/communication is somewhat important, I suggest you use some kind of middleware. Using message middleware, you simply put messages with whatever content you want on a queue (hosted by a queue manager), the payload of the message can be XML, serialized java objects, binary or text. The receiver simply picks up the message from the queue with a simple API call. No need for messy TCP/IP code in your projects.

    Active MQ (a queue manager, there are lots of brands) can be found here.

    Here are some examples on how to use JMS to send and receive messages.

    Then, if this does not suite you, then you can always go back to sending TCP/IP messages. That can be hard or easy. You probably want to use some framework if you have somewhat complex communication. Here is one framework, there are others,
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion