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.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
52 views
IMServer Java
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.