0% found this document useful (0 votes)
22 views

Programming Assignment#1

The document describes Programming Assignment #1 which involves implementing a simple client-server communication using socket programming. The client connects to the server on a predefined port, sends a text message, and receives the message back along with the character count. The server outputs the message, sends it back to the client, and remains running to receive more messages. The connection is then gracefully terminated by the client and server.

Uploaded by

adityabaid4
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Programming Assignment#1

The document describes Programming Assignment #1 which involves implementing a simple client-server communication using socket programming. The client connects to the server on a predefined port, sends a text message, and receives the message back along with the character count. The server outputs the message, sends it back to the client, and remains running to receive more messages. The connection is then gracefully terminated by the client and server.

Uploaded by

adityabaid4
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 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