Back to UNIX page

UDP counter

Write client server application. Server reads datagrams consisting of one 32 bit integer and sends them back with the number decreased by one. With 50% probability response is dropped to simulate udp packet loss.

Client sends the number 'n' and waits 0,5 sec. for response. If none is received it must retry to send the packet (one more time). On success client prints the received number. In failure it prints "FAILED".

Client and server are started from one executable, the role depends on the parameters. If the executable is started with only one parameter (port number)- it is a server. If it is started with 3 parameters (host port n) - client.

Task will be graded by Marcin Borkowski. Copy your solutions to /home2/samba/borkowskim/unix/ .

Extra attention should be payed to:

Back to UNIX page