资 源 简 介
Client程序同样分别创建一个TCP socket 和一个UDP socket,首先client使用TCP socket连接TCP Server。
连接成功后显示提示信息;
然后client端向TCP Server发送“GET UDP PORT”字符串,Server收到后向client回送自己的UDP Server 端口号(即Client端仅知道TCP Server的端口号而不知道UDP Server的端口号);
client在收到UDP Server的端口号后, 为用户显示3个选项:
1.“Get current time(TCP)”服务器时间
2.“Echo Mode(UDP)”回显6
3.“Exit the program”.
-Client program also creates a TCP socket, respectively, and a UDP socket, the first client to use TCP socket connection TCP Server. After a successful connection displays a prompt message and then client-side to the TCP Server sends " GET UDP PORT" string, Server receipt back to the client to send their UDP Server port number (ie, Client-side only to know the TCP Server" s UDP port number do not know Server" s port number) client received UDP Server port number, in order to the user three options: 1. " Get current time (TCP)" server time 2. " Echo Mode (UDP)" echo 63. " Exit the program" .