You are on page 1of 1

Programming Assignment #1: A Simple communication using socket programming (10 + 3)

Use socket programming to implement a simple client-server based Communication as follows. The client opens a session with the server (at an IP address) on a predefined port and then supplies a line of Text Message. The server outputs the Text Message on the standard output, sends back the Text message it has received from the client along with the character count of the Text message, and also keeps on running to receive more Text Messages. The client prints the line of Text message received from the server and closes the session. The connection to the server should be gracefully terminated. When the server is terminated by pressing control C, the server should also gracefully release the open socket. (it needs a signal handler)
Prototypes for Client and Server
Client : <executable code> <Server IP Address> <Server Port number> Server : <executable code> <Server Port number>

Example:
Client Terminal $./client 192.168.125.6 6666 Hello! How are you? Hello! How are you? (19) $ Server Terminal $ ./server 6666 Hello! How are you?

Deadline: On or Before August 24, 2012

You might also like