📄 readme
字号:
UDP echo client and server code.The server creates a UDP socket and waits for incoming UDP datagrams(after printing out the port assigned by the operating system). Eachtime a new datagram is received, the server sends the datagramunchanged back to the sender.The server also prints out the IP address and port number of the client.-----------------The client reads from standard input until end of file (^D) and sendsthe whole thing as a single datagram to the server specified by thecommand line parameters. The parameters are the hostname and the portnumber. The client calls gethostbyname to determine the IP address ofthe server. For example, to tell the client that the server is runningon the machine foo.cse.cuhk.edu.hk and on port 2030 the client should bestarted like this:client foo.cse.cuhk.edu.hk 2030Once the client sends a datagram it waits until it receives a datagramand then writes the data received to stdout. Since the server is the onlyprocess that knows the port number of the client, we assume it is theonly process that could be sending anything...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -