nanog mailing list archives

Re: I don't need no stinking firewall!


From: William Herrin <bill () herrin us>
Date: Sun, 10 Jan 2010 12:54:24 -0500

On Sun, Jan 10, 2010 at 12:47 PM, William Herrin <bill () herrin us> wrote:
Even if it does
send an RST, most application developers aren't well enough versed in
sockets programming to block on the shutdown and check the success
status,

Sorry, I got that wrong. shutdown() will succeed without waiting for a
FIN or RST from the remote end. So will close(). Instead, after the
shutdown() you then have to block on read() waiting for a either 0
bytes read or an error. 0 bytes = FIN, error = RST.

Unfortunately, few sockets programmers realize that they have to do
this to catch that final possible error. They send what the expect to
send and if they don't expect to receive anything back, they shutdown
and close the socket without waiting.

Regards,
Bill Herrin

-- 
William D. Herrin ................ herrin () dirtside com  bill () herrin us
3005 Crane Dr. ...................... Web: <http://bill.herrin.us/>
Falls Church, VA 22042-3004


Current thread: