CS 471 - Operating Systems

Due Midnight, Thursday Feb 28, 2013

 

Implement the following two programs:

 

ChatServer  <port>

ChatClient   <host>  <port>

 

ChatServer Description:

 

ü The main thread create an information thread to accept tcp  a connections on a  server socket binded to port+1.

For each accepted connection, it sends a list L  of < ip, port> of all currently connected chat clients and then close the connection.

ü The main thread accepts tcp connections from chat clients on server socket binded to port.

For each accepted connection, it creates a chat thread  that sends any received  message from the connection to all currently connected  chat clients.

 

ChatClient Description:

 

ü Connects to the ChatServer  at port

ü Creates a  thread  to reads  messages from the stdin and sends it to the ChatServer.

ü Reads the received messages from the ChatServer and displays it to the stdout.

ü When it receives an INT signal, it connects to the ChatServer at port+1 and displays the received information to the stdout.        

You may execute my solutions at:                      

http://www.cs.odu.edu/~cs471w/spring13/assignments/a2/wahab