Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Client Connecting to Multiple Servers  RSS feed

 
Jeff Schulmeister
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Currently I have several servers listening on a port. in order for my client to connect when it wants to communicate, I have to open the connection, communicate and then close it for each server, before connecting to the next server. If I try to open multiple connections on the same port, the client seems to get confused.

Is there a simple example of a client communicating with multiple servers using the same port, without having to open and close each connection for every read or write? or is this a limitation of java? I've tried threading and declaring my runnable code as synchronized, but the client closes if I happen to send data, while that port is in use by another function.




 
Jeff Storey
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using TCP or UDP? You can use UDP/multicast to accomplish what you're trying to do.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!