This document contains the code for an IMServer class written in Java. The IMServer class extends the Thread class and runs a server on port 7777 that accepts incoming client connections and broadcasts messages between all connected clients. When a new client connects, it is added to a pool of PrintWriters and its messages are broadcast to all other clients. When a client disconnects, it is removed from the pool.
This document contains the code for an IMServer class written in Java. The IMServer class extends the Thread class and runs a server on port 7777 that accepts incoming client connections and broadcasts messages between all connected clients. When a new client connects, it is added to a pool of PrintWriters and its messages are broadcast to all other clients. When a client disconnects, it is removed from the pool.