Add new post, fix subtitle in socket post.

This commit is contained in:
2016-05-09 17:19:07 -04:00
parent e6d07f70fb
commit cb007fb918
2 changed files with 6 additions and 1 deletions

View File

@ -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>