用mina做了一個UDP接收的程序,綁定的時候沒有指定IP,只是指定了端口。
然后還是在本機連接127.0.0.1和UDP端口號,死活收不到數據。
用TCP/UDP工具發送數據,提示如下:
The virtual circuit was reset by the remote side executing a hard or abortive close. The application should close the socket as it is no longer usable. On a UPD-datagram socket this error would indicate that a previous send operation resulted in an ICMP "Port Unreachable" message.
解決辦法:
沒有指定IP,就是默認0.0.0.0。
改為在具體的IP地址綁定,例如192.168.0.10,發現能收到數據。