2
|_|_ _ / _ \/ ___/ ___|| _ \ ___ __ _
3
_|_||_| | | | \___ \___ \| |_) | / __|/ _` |
4
|_||_|_| | |_| |___) |__) | __/ \__ \ (_| |
5
|_|_|_| \___/|____/____/|_| |___/\__,_|
7
OSSP sa - Socket Abstraction
11
The following items still have to be done:
17
The following items can be done if wished and time permits:
19
o Add support for more socket options, for instance SO_BROADCAST for
20
enabling permission to transmit broadcast messages.
22
o what about actually written bytes in case of sa_writef?
23
Should we internally retry somehow?
25
o provide Perl glue module SA.
27
o provide "satool", a command line interface to the OSSP sa API.
28
Can optionally use readline or libedit, etc.
30
o support for SSL/TLS via small abstraction layer on top of OpenSSL and
33
o Consistently use PF_XXX instead of AF_XXX whenever not directly
34
address related things are done in order to even closer conform to POSIX.
36
o DNS Resolving and multiple results.
38
On DNS resolving name, multiple result addresses can be returned. Either
39
because of Round-Robin entries, multi-homed hosts or because of hosts
40
talking both IPv4 and IPv6, etc. Each address has to be tried on
41
socket+connect. What to do? For some hints see:
42
http://www.v6.wide.ad.jp/Presentations/ai3-penang0010-v6programming/mgp00015.html
44
o Nagle's Algorithm and Flushing of Output Buffers.
46
The kernel performs Nagle's Algorithm (see RFC 896 and search for "nagle
47
algorithm" on www.whatis.com [currently
48
http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci754347,00.html]
49
on his internal output buffers. Although we flush our user-space output
50
buffers only if we really perform a read(2) (and not if the read is going to
51
be served entirely from the local buffer) this does not mean that really
52
every character the remote has already sent is also already read by us.
53
Because the kernel also has a read buffer. Optimal behaviour would be that
54
we flush out output buffer only if the read(2) would block. OTOH flushing
55
out buffers means performing a write(2) and this again is buffered in the
56
kernel, too. So performing an optimal read->write->read->write->... sequence
57
is very complex and non-trivial to implement. Especially because even using
58
Nagle's Algorithm always is not the right choice (see
59
http://www.w3.org/Protocols/HTTP/Performance/Nagle/ for details), especially
60
when it comes to pipelining protocols.
62
o Support for writev(2).
64
This can be done by internally switching to always use writev(2),
65
providing an emulation for writev(2) ala Pth and by basing the write
66
calls always on writev.
68
o Kernel Read/Write Buffer Adjustments.
70
BSD Sockets usually provide (see setsockopt(2)):
72
SO_SNDBUF set buffer size for output
73
SO_RCVBUF set buffer size for input
74
SO_SNDLOWAT set minimum count for output
75
SO_RCVLOWAT set minimum count for input
77
This would mean that we could also allow the control
78
of the kernel buffers via
83
Unfortunately the whole kernel buffer issue is very complex, because
84
according to STEVENS there are both minimum and maximum sizes and both
85
borders heavily depend on the currently used protocol (TCP or UDP) and
86
the MTU of the underlying network, etc. This all together seems like
87
opening a can of worms if we provide SA_BUFFER_K{READ,WRITE}.