From: Alan Kennedy <report@bu...> - 2009-04-08 10:23:32
New submission from Alan Kennedy <jython-dev@...>:
Server sockets currently support three options: SO_RCVBUF, SO_REUSEADDR
and SO_TIMEOUT. Atttempts to set other options fail with an exception.
Client sockets have a number of options which are not applicable to
server sockets, e.g. SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE,
SO_REUSEADDR, SO_SNDBUF, and TCP_NODELAY. In some socket
implementations, it is possible to set client-specific options on a
server socket, so that client sockets newly created with accept() can be
configured with (i.e. "inherit") those values. This is not currently
possible on jython.
The attached patch implements such functionality. But the patch contains
no unit tests, and is thus not yet ready for application to the socket
Before the patch can be applied, the following questions must be addressed.
1. Currently java server sockets support SO_RCVBUF (through the
setReceiveBufferSize() method). This option has no meaning for server
sockets, but is used to configure newly 'accept'ed client sockets. Why
does java do this for SO_RCVBUF, but not for SO_SNDBUF?
2. Contrary to other socket implementations, e.g. BSD, Java specifically
does *not* inherit the SO_TIMEOUT value from server sockets to client
sockets. Given the proposed modification, how is an SO_TIMEOUT value set
on a server socket to be interpreted?
- Stick with the java policy, and do NOT inherit the option?
- Implement the BSD policy and inherit the option, even though that
may not be what the user intended?
3. What is the commonly accepted (BSD?) "inheritance policy" for
inheritance of the following client-specific options?
These questions need to be answered by
A: Researching how other systems address these issues
B: Finding out what cpython does
C: Finding out what the python community expects
keywords: RFE, patch
nosy: amak, pjenvey
title: Server sockets do not support client options and propagate them to 'accept'ed client sockets.
Added file: http://bugs.jython.org/file646/pending_client_options.patch
Jython tracker <report@...>