我试图通过udp socket发送数据,客户端是:
sock.sendto(msg, ('127.0.0.1', 5055))
当服务器正在侦听时:
si_me.sin_family = AF_INET;
si_me.sin_port = htons(5055);`enter code here`
si_me.sin_addr.s_addr = htonl(INADDR_ANY);
if ((recv_len = recvfrom(s, buf, BUFLEN, 0, (struct sockaddr *) &si_other, &slen)) == -1)
这可能会失败,因为在一台机器上我无法接收任何数据吗?