|
|
Log in / Subscribe / Register

TCP Fast Open: expediting web services

TCP Fast Open: expediting web services

Posted Aug 1, 2012 21:57 UTC (Wed) by pj (subscriber, #4506)
Parent article: TCP Fast Open: expediting web services

Why do clients have to change to using sendto() or sendmsg() ? Couldn't the charter of connect() be changed a little iff TCP_FASTOPEN is set to make it be a bit more 'lazy' so it doesn't actually attempt a connection until something is written to it?


to post comments

TCP Fast Open: expediting web services

Posted Aug 1, 2012 22:21 UTC (Wed) by nix (subscriber, #2304) [Link] (3 responses)

I can't see a sensible way for connect(2) to determine if it should return ECONNREFUSED without that first SYN/ACK roundtrip. :)

(You'll note that sendmsg(), being intended for connectionless protocols, isn't documented as being able to return ECONNREFUSED either. I suspect this oversight will be rectified in due course.)

TCP Fast Open: expediting web services

Posted Aug 1, 2012 23:00 UTC (Wed) by josh (subscriber, #17465) [Link] (1 responses)

Just document that if you connect with the TCP_FASTOPEN flag you can potentially get ECONNREFUSED from whatever later call you use to write data to the socket.

TCP Fast Open: expediting web services

Posted Aug 2, 2012 22:56 UTC (Thu) by nix (subscriber, #2304) [Link]

Quite. The set of errors in the manpages (and, indeed, in POSIX) is not a total set -- the kernel is allowed to return other errors, though it is perhaps unwise to expect callers to expect those errors.

TCP Fast Open: expediting web services

Posted Aug 1, 2012 23:11 UTC (Wed) by dskoll (subscriber, #1630) [Link]

Well, connect could return EINPROGRESS if the option is used as it does for a non-blocking socket. That's a bit of a lie, though. :)

TCP Fast Open: expediting web services

Posted Aug 8, 2012 14:45 UTC (Wed) by kevinm (guest, #69913) [Link]

...and you could request fastopen by setting TCP_CORK before connect(); write(); then uncorking.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds