This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Multiple sockets cause Threads Hangin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Multiple sockets cause Threads Hangin " Watch "Multiple sockets cause Threads Hangin " New topic
Author

Multiple sockets cause Threads Hangin

chris achalon
Greenhorn

Joined: Aug 20, 2003
Posts: 2
Hello, I need help.
First, let me explain what I'm doing:
I'm building a web messenger program for in-house tech support for my workplace.
The concept:
A user on the internet clicks a link, this opens a Client program. The client program connects to the server here in the building. The server in turn, connects to a MessageDaemon program running on an Admin's computer. The MessageDaemon then opens a Client program on the Admin's comp so the user may speak to him. This should be able to happen multiple times. Each time a new person connects, the Admin will open a New Client to speak with them. Note: This is a one to one connection, one admin speaking to one user is all the user sees. But that one admin may be running multiple Client programs on his comp.
The problem:
Everything works until the server tries to accept the data sent from both Client programs. Each client program is comming in over a different socket and port. While they can both connect to the server with no problem, I don't know how to get the server to read their data correctly. My problem is in the following lines:

I have tried multiple variations of these lines using if statements and such, but nothing works! I understand the problem, I just don't know how to fix it!
Here is the full server code:

Can anyone help me please?
chris achalon
Greenhorn

Joined: Aug 20, 2003
Posts: 2
Boy that code is small, that initial code is in the middle of the HandleAClient Class at the bottom.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Multiple sockets cause Threads Hangin
 
Similar Threads
client-serer...plz help
display http header
Client / Server Question
Socket program for linux
port number