Eiffel Web Framework, app run on linux raises `Address already in use: IO_FAILURE raised`

核能气质少年 提交于 2019-12-11 16:40:24

问题


After stopping an EWF app and starting it again in a Address already in use: c_bind Address already in use: IO_FAILURE raised

As explained here, it seems that TCP socket timeout is not available for some time before being released by OS.


回答1:


The best workaround I found is

sudo sh -c 'echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle'

Credits to this answer

I believe that the idea of the socket being unavailable to a program is to allow any TCP data segments still in transit to arrive, and get discarded by the kernel. That is, it's possible for an application to call close(2) on a socket, but routing delays or mishaps to control packets or what have you can allow the other side of a TCP connection to send data for a while. The application has indicated it no longer wants to deal with TCP data segments, so the kernel should just discard them as they come in.

did change things. The second "opener" only took about 3 seconds to get its new socket.



来源:https://stackoverflow.com/questions/53932111/eiffel-web-framework-app-run-on-linux-raises-address-already-in-use-io-failur

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!