I am using java.net.Socket.connect()
to connect to an FTP server in passive mode on AppEngine. It works around 30% of the time, but I usually get the following error:
java.net.SocketException: System error: errno: 99, detail:Cannot assign requested address
It sounds as though the host simply doesn't have any available ports for outgoing connections (I am not requesting a specific port.) I get the same result when I use new java.net.Socket()
I would appreciate any thoughts as to what might be happening.
打开用于FTP的套接字时,我遇到了很多相同的错误,但是在设置socket.setSoLinger(true, 0)
和socket.setReuseAddress(true)
之后,错误率降低了。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.