UDP客户端帮助 [英] UDP Client help
问题描述
我有一个问题,我的编程能力很差,并且要编写UDP客户端.
客户端软件应获取与之通信的服务器的IP地址和端口号(位于命令行中).
然后:
*它从标准输入中读取一行文本,
*将此文本以UDP数据报的形式发送到服务器,
*等待UDP数据报响应,
*,然后在标准输出上打印文本,并在前面加上服务器的套接字地址(来自传入的数据报).
重复此过程,直到在标准输入上检测到EOF.
如果有人可以提供任何帮助,我将不胜感激.
非常感谢.
Hi,
I have a problem, I am very bad at programming and have a UDP client to write.
The client software should take the IP address and port number of the server it is talking to (poss on command line).
Then:
* It reads a line of text from standard input,
* sends this text in a UDP datagram to the server,
* waits for a UDP datagram in response,
* and then prints the text on standard output, prepended with the server''s socket address (from the incoming datagram).
The process is repeated until EOF is detected on standard input.
If anyone can offer any help I would appreciate it.
Many thanks.
推荐答案
阅读此 [ ^ ]文章,然后查看客户端程序"部分.另请参阅 Winsock [
Read this[^] article, and look into the "Client Program" section of it. Also look at Winsock[^] for further details.
这篇关于UDP客户端帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!