Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

sockets and close/shutdown/RST packets

Dear Lazyweb,

Network programming question:

I have a listening socket. Client connects to it, and I write a bunch of data to it, in chunks as it becomes writable. After I'm done writing and want to properly close the connection, what do I have to do?

a) just close the socket?
b) shutdown and close the socket?
c) wait for socket to become writable again, and (a) or (b)?

I'd thought it was just (a), but Perlbal is sending RST packets like crazy when I do that. If I put in arbitrary delays before the close, the RST packets go away, but that's really hacky and lame.

We'd never noticed this on LiveJournal.com before, because the BIG-IP sanitizes the situation to some degree, but RST packets still reach end users, and it's technically wrong. Also, other sites (like discogs.com) which are behind Alteons don't handle the RST packets well.

*braced for cluestick beating*

Educated me. Thanks!
Tags: lazyweb, perlbal, tech
Subscribe

  • Ukraine

    Nobody reads my LiveJournal anymore, but thank you to everybody in Russia protesting Putin's insane war against Ukraine. (I know it's risky…

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 15 comments

  • Ukraine

    Nobody reads my LiveJournal anymore, but thank you to everybody in Russia protesting Putin's insane war against Ukraine. (I know it's risky…

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.