return to UNIX

Write a multi-threaded udp timer server and simple udp client. Client sends number of seconds it needs to be counted to the server and awaits server response. Server starts separate thread for each new request. The thread sleeps for given time and sends the same time as a response. Then the thread exits. Upon response arrival client prints the message "TIME has expired" and exits. In case of udp packet disappearance client has additional timeout of 15 seconds. On timeout client prints "TIMEOUT" and exits.

Server has a limit of 10 concurrent threads. If it receives more requests, client is sent immediate response (-1). On such a response the client prints "Service Denied" and exits.

Server uses only one socket, datagrams are formated as int16_t, limit on concurrent threads can be imposed with POSIX semaphore.

Please upload the solutions to /home/samba/borkowskim/unix/

Additional Remarks:
return to UNIX