Presentation is loading. Please wait.

Presentation is loading. Please wait.

Socket Lab Info. Computer Network. Requirement Use TCP socket to implement a pair of programs, containing a server and a client. The server program shall.

Similar presentations


Presentation on theme: "Socket Lab Info. Computer Network. Requirement Use TCP socket to implement a pair of programs, containing a server and a client. The server program shall."— Presentation transcript:

1 Socket Lab Info. Computer Network

2 Requirement Use TCP socket to implement a pair of programs, containing a server and a client. The server program shall wait for connections on port 33568. The client program shall be able to connect to this server with given ip address and port number.

3 Requirement(cont’d) When connection is successfully established, server shall provide the file information it hold. Client then use the provided file information to request for download. Server start transmitting file stream to client if the request is correct. Server close the connection immediately when the file is completed transmitted. Client shall detect the read() function that returns a zero value, which means the connection is closed by the sever, thus close the socket at client side.

4 Spec. Detail Server use message “FILE:102062599.txt” to claim the file information. The file name is required to be one of your teammates student ID. Client use message “GET:102062599.txt” to request for downloading the file. The file name depends on what the server claims.

5 Spec. Detail (cont’d) In the txt file, you should write down all the teammates’ student ID. The file name in this lab is hard coded in the program. Server sends the file information automatically when a client is connected initially.

6 Diagram Client start to connect to server. Connect:140.114.76.55:33568 Server Client

7 Diagram Server send the file information. Server Client FILE:example.txt

8 Diagram Client send the request message. GET:example.txt Server Client

9 Diagram Server start transmitting file data. Server Client Trasmitting data….

10 Diagram Transmission complete, close the connection. Server Client Close connection

11 Remark The exchanging messages “CLOSE:” we required previously, is now remove from the spec.. Server and client now just close the connection immediately when read() <= 0 is detected. TAs will use our client and server program to verify if you correctly implement the required messages protocol.


Download ppt "Socket Lab Info. Computer Network. Requirement Use TCP socket to implement a pair of programs, containing a server and a client. The server program shall."

Similar presentations


Ads by Google