• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple sockets cause Threads Hangin

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Boy that code is small, that initial code is in the middle of the HandleAClient Class at the bottom.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic