ryah ([info]four) wrote,
@ 2009-05-02 18:12:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Entry tags:programming

TCP
I think the proper abstraction of a TCP socket (both sides) is something like this

events:
- connected
- received data
- send buffer drained
- got FIN
- done

methods:
- connect (for clients only)
- send
- close (sends FIN, shutdown(fd, SHUT_WR))

this is rather tricky to get right. (posix's unholy mixture of sockets and files aids to the confusion.) am i missing anything?




Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…