On Thu, 19 Jun 2008 10:04:47 +0200
Niklas Therning <[EMAIL PROTECTED]> wrote:

> 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
> 

I'm a bit daft this morning, I can't find any coffee,

I commited a fix for that, SocketAcceptor and SocketConnector override
getSessionConfig with the good IoSessionConfig subclass.
http://svn.apache.org/viewvc?view=rev&revision=669418

Julien

Attachment: signature.asc
Description: PGP signature

Reply via email to