Julien Vermillard skrev:
On Mon, 16 Jun 2008 22:54:58 +0200
Emmanuel Lecharny <[EMAIL PROTECTED]> wrote:
Hi gang,
I have recently reviewed some part of the IoSession inheritence tree,
and discovered that some interfaces are just useless :
- SocketSession
- DatagramSession
I suggest we remove them (it won't harm the project or the tests in
any case).
Anyone see a reason to keep those useless and undocumented
interfaces ?
Thanks !
I found a side effect :
SocketConnector connector = new NioSocketConnector();
connector.setHandler(handler);
connector.setConnectTimeoutMillis(2000);
connector.getSessionConfig().setReaderIdleTime(10);
connector.getSessionConfig().setWriterIdleTime(10);
In place of writing :
connector.getSessionConfig().setTcpNoDelay(true);
You need to cast like that :
((SocketSessionConfig)connector.getSessionConfig()).setTcpNoDelay(true);
Julien
I think this is exactly why these interfaces were introduced, to be able
to use Java5 covarient return types. I wouldn't say they are useless
because they obviously save you from doing casts like this.
/Niklas