ZiBaT => Peter Levinsky => Programming => exercise

Network Programming
Different Servers

Updated : 2016-09-12

Networking Programming - TCP server

Mission:

To design and implement an echo server and echo client using TCP additional using UDP.

To design and implement a Chat server / client.

Exercise 1: Create a Tcp Echo Server

Create a server that can echo incomming string request to the client.

Make a server that receive a tcp connection from a client, read the incomming string and write back the string in Upper Case.

The server should listen on port 7 according to the standard (RFC 862).

Exercise 2: Create a Tcp Echo Client

Create a client that can send a string to the echo server and receive the response.

Make a client that read a string (a line) from the keybord, create a tcp connection to the server, and read the responding string.

Exercise 3: Modify the Tcp Echo Server to be iterative (i.e. can handle multiple clients)

Refactor the server to wait for incomming connections in a loop and handle each client in a seperate task.

To start a task use: Task.Run( () => {handleOneClient()} ) see more about Task

Exercise 4: Create a Udp Echo Server

Create a server that can echo incomming string request to the client.

Make a server that receive a udp datagram from a client, read the incomming string and send back the string in Upper Case.

The server should listen on port 7 according to the standard (RFC 862).

Exercise 5: Create a Udp Echo Client

Create a client that can send a string to the echo serve and receive the response.

Make a client that read a string (a line) from the keybord, create a udp datagram to the server, and receive the responding datagram and print out the string.

Exercise 6: Create a Chat system

Design a chat system which can send and receive messages.