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 Newbie question on trying to create multiple sockets (connections) to same port 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 "Newbie question on trying to create multiple sockets (connections) to same port" Watch "Newbie question on trying to create multiple sockets (connections) to same port" New topic
Author

Newbie question on trying to create multiple sockets (connections) to same port

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 386

In the code below, I establish the first connection without issue however, when I come back around in my while statement (highlighted in BOLD RED below) at the newSocket = serverSocket.accept(); line my program stops there. The objective is to allow multiple connections to one PORT. I'm in the middle of re-factoring an inherited application that has been working but only allowing one connection to one port at a time. This is my first crack at socket programming and any suggestions/direction would be greatly appreciated. Thanks.

Here is the code that I'm working with:

 
Don't get me started about those stupid light bulbs.
 
subject: Newbie question on trying to create multiple sockets (connections) to same port
 
Similar Threads
proxy server in java
SocketException: Too many open files
PC Connected to Internet and Internet Connectivity?
Sockets vs URL Based classes
ObjectStream client-server object sharing problem.