This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes mutiple socket connection issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "mutiple socket connection issue" Watch "mutiple socket connection issue" New topic

mutiple socket connection issue

kinson joy

Joined: Dec 19, 2011
Posts: 1
Hi I have server code:

And client socket is connected to server and loop to send message to server, at end of each loop to close socket:

The problem is server can only receive message at first loop, then it cannot get any message after other ones.

At the server side, if we don't set running as false when capture socket close ( which mean keep first thread alive), then work fine, at this case, server will increase number of thread if there are a lot of client to connect? how to solve this issue?



I agree. Here's the link:
subject: mutiple socket connection issue
Similar Threads
Qn regarding sockets in SCJD
Multithreading client socket throws Stream corrupted exception
applet loading forever...
client / server (communication problem...)
Problem with echo server and client.