Add new post, fix subtitle in socket post.
This commit is contained in:
@ -49,3 +49,8 @@ Otherwise you end up with sockets hanging out forever in CLOSE_WAIT.
|
||||
In other words, if a socket is stuck in CLOSE_WAIT, it is necessarily a fault in the application - the application is failing to check for the connection closing, and thus never calls `close()`.
|
||||
|
||||
This problem is common in applications that do nothing but `write()` to their sockets (they never `read()` so they never detect the EOF). To prevent this problem, any program that opens a socket must occasionally try to `read()` from the socket to make sure it isn't writing data into a closed connection. If blocking on read is a problem, you can open the socket with the O_NONBLOCK flag.
|
||||
|
||||
|
||||
<small>
|
||||
<sup>1</sup>Many languages and libraries abstract these calls and make opening sockets much, much easier. On any Unix-like system, though, they all make these calls eventually, since they are kernel syscalls.
|
||||
</small>
|
||||
|
Reference in New Issue
Block a user