This discussion is archived
2 Replies Latest reply: Jul 25, 2010 11:56 PM by 791266 RSS

Which application should be the server ?

843790 Newbie
Currently Being Moderated
Hi,

I have two Java applications which need to send each other messages through Socketchannels (I use the NIO library).
I can't decide which should be the server and which the client (they both know each other's ip).
Does it matter anyway ? Is there any difference ? (by the way, the code between client and server, using NIO, seems almost the same...)

Thank you for any clarifications on this!
Matthew
  • 1. Re: Which application should be the server ?
    3004 Newbie
    Currently Being Moderated
    mathiii wrote:
    Hi,

    I have two Java applications which need to send each other messages through Socketchannels (I use the NIO library).
    I can't decide which should be the server and which the client (they both know each other's ip).
    The one on the left should be the server.

    Seriously though, you haven't told us anything about either one of them, so how can anybody give you any concrete suggestions? All I can say is that as a general rule, if A is conceptually providing a service, and the normal interaction is that B asks A for something and then sends back a response, A would be considered the server. If they're conceptually peers, and communication can arbitrarily originate at either end, and there's no clear "service provider," then, no, it doesn't matter.
  • 2. Re: Which application should be the server ?
    791266 Explorer
    Currently Being Moderated
    >

    What does the application do? How come the applications know about the ip addresses?