implement TCP Fast Open support (client + server)
commitf61cef65b8a8816160c622324b4f1aad55034e4a
authorEric Wong <normalperson@yhbt.net>
Thu, 27 Dec 2012 01:16:56 +0000 (27 01:16 +0000)
committerEric Wong <normalperson@yhbt.net>
Thu, 27 Dec 2012 01:23:34 +0000 (27 01:23 +0000)
treed5c5b285acb51b12bf407e03f304ab602c283a3d
parent7a3fc55424338ad458cc719d4cb3c4e28802d5cb
implement TCP Fast Open support (client + server)

Server support just requires exposing one constant for
setsockopt: Kgio::TCP_FASTOPEN

Client support implements a new Kgio::Socket#fastopen method.
This new method wraps the the sendto() syscall.  With TCP Fast
Open, the sendto() syscall is overloaded for stream sockets to
implement the functionality of both connect() + write()

Since it only makes sense to use _blocking_ I/O for sendto(),
TFO clients are only supported in Ruby implementations with
native threads.
ext/kgio/connect.c
ext/kgio/kgio.h
ext/kgio/kgio_ext.c
test/test_tfo.rb [new file with mode: 0644]