Skip to content

Instantly share code, notes, and snippets.

@shawwn
Created April 25, 2013 09:58
Show Gist options
  • Save shawwn/5458731 to your computer and use it in GitHub Desktop.
Save shawwn/5458731 to your computer and use it in GitHub Desktop.
(define E_AGAIN 11)
(define (try-unix-socket-accept s)
(let-values ([(them addr) (_accept s (sockaddr-len))])
(if (or (> them -1) (not (eqv? (saved-errno) E_AGAIN)))
(values them addr)
(begin
(sleep 0.1)
(try-unix-socket-accept s)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment