ossp-pkg/sa/TODO
1.29
TODO
----
- on resolving multiple addresses can be returned (especially
one IPv4 and one IPv6!) and each one has to be tried on
socket+connect for instance. What to do? See also
http://www.v6.wide.ad.jp/Presentations/ai3-penang0010-v6programming/mgp00015.html
- support for new getaddrinfo and getnameinfo (IPv6!)
- API function for blocking/non-blocking I/O mode
- more test cases to cover full API
- more documentation to fully describe API
CANDO
-----
o Nagle's Algorithm and Flushing of Output Buffers.
The kernel performs Nagle's Algorithm (see RFC 896 and search for "nagle
algorithm" on www.whatis.com [currently
http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci754347,00.html]
on his internal output buffers. Although we flush our user-space output
buffers only if we really perform a read(2) (and not if the read is going to
be served entirely from the local buffer) this does not mean that really
every character the remote has already sent is also already read by us.
Because the kernel also has a read buffer. Optimal behaviour would be that
we flush out output buffer only if the read(2) would block. OTOH flushing
out buffers means performing a write(2) and this again is buffered in the
kernel, too. So performing an optimal read->write->read->write->... sequence
is very complex and non-trivial to implement. Especially because even using
Nagle's Algorithm always is not the right choice (see
http://www.w3.org/Protocols/HTTP/Performance/Nagle/ for details), especially
when it comes to pipelining protocols.
o Support for writev(2).
This can be done by internally switching to always use writev(2),
providing an emulation for writev(2) ala Pth and by basing the write
calls always on writev.
o Kernel Read/Write Buffer Adjustments.
BSD Sockets usually provide (see setsockopt(2)):
SO_SNDBUF set buffer size for output
SO_RCVBUF set buffer size for input
SO_SNDLOWAT set minimum count for output
SO_RCVLOWAT set minimum count for input
This would mean that we could also allow the control
of the kernel buffers via
SA_BUFFER_KREAD
SA_BUFFER_KWRITE
Unfortunately the whole kernel buffer issue is very complex, because
according to STEVENS there are both minimum and maximum sizes and both
borders heavily depend on the currently used protocol (TCP or UDP) and
the MTU of the underlying network, etc. This all together seems like
opening a can of worms if we provide SA_BUFFER_K{READ,WRITE}.