View Single Post
  #8 (permalink)  
Old 10-15-2008, 11:46 PM
Norm's Avatar
Norm Norm is offline
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,225
Norm is on a distinguished road
There is an object that is NULL in your code.
Copy and post the FULL text of the error message. The error message will have a line number in your program that you can look at to see what object was null.

I'd change the design to have only one server. When it receives a login message from a client, it should create an object for that client(Define a new class here) and save it in some kind of collection, like an ArrayList. Then when the server gets a message to send to all clients, it can go thru the collection of logged in clients, get their addresses and send them the message.
Reply With Quote