用CAsyncSocket创建UDP的socket,收到数据后,如何得知客户的IP和端口号
用CAsyncSocket创建UDP的socket,收到数据后,怎么得知客户的IP和端口号?
初学socket编程,遇到这个问题就挂了,呵呵。
------解决方案--------------------
The destination port number of the data is required when you send your packet.
If you want to know who received your broadcasting, use TCP/IP to send something back.
------解决方案--------------------
udp的CAsyncSocket::ReceiveFrom的第3,4个参数可以得到对方的ip端口
初学socket编程,遇到这个问题就挂了,呵呵。
------解决方案--------------------
The destination port number of the data is required when you send your packet.
If you want to know who received your broadcasting, use TCP/IP to send something back.
------解决方案--------------------
udp的CAsyncSocket::ReceiveFrom的第3,4个参数可以得到对方的ip端口