CS 145A Lab 1 (due: Oct 24th)

Connection

Tasks for Lab 1

Server

The parameter format of the server is: "server <port 1> <port2>", where <port 1> is the port number for TCP service, <port 2> is the port number for UDP service.

The server should implement the following functions:

Submission:

Please submit your codes in "server.c" or "server.cpp", and your documents in "server.txt"

Tips:

TCP Client

The parameter of the TCP client is "tcpclient <host> <port> <message> <time> ", where <host> is the server's IP; <port> is the server's port for TCP, <message> is the message you want to send, <time> is the waiting time for the client before disconnection. <message> contains English characters only.

The tcpclient should implement the following function:

Submission:

Please submit your codes in "tcpclient.c" or "tcpclient.cpp", and your documents in "tcpclient.txt"

UDP client

The parameter of the UDP client is "udpclient <host> <port> <message>", where <host> is the server's IP; <port> is the server's port for UDP, <message> is the message you want to send. <message> contains English characters only.

The udpclient should implement the following function:

Submission:

Please submit your codes in "udpclient.c" or "udpclient.cpp", and your documents in "udpclient.txt"

Requirements of Documentation

Please add enough comments in your codes (enough to show your understanding of the work).

Please use the documents (*.txt) to describe:

Suggestions

Grading