Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple sockets cause Threads Hangin

 
chris achalon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Boy that code is small, that initial code is in the middle of the HandleAClient Class at the bottom.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic