|
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.
|