You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Mark Webb <el...@gmail.com> on 2008/03/04 19:21:37 UTC

MINA NioDatagramAcceptor reading one UDP packet at a time

If I want to have a program that received UDP packets.  Do I need to
write a protocol filter in order to make sure my
IoHandler.messageReceived() method only gets one packet at a time?

Thanks

Re: MINA NioDatagramAcceptor reading one UDP packet at a time

Posted by Eero Nevalainen <ee...@indagon.com>.
Mark Webb wrote:
> If I want to have a program that received UDP packets.  Do I need to
> write a protocol filter in order to make sure my
> IoHandler.messageReceived() method only gets one packet at a time?
> 
> Thanks
> 

I took a look at it and my guess would be that only packet at a time is 
read. The relevant code seems to be
DatagramConnectorDelegate.readSession( DatagramSessionImpl session )

and the API description of

DatagramChannel.read( ByteBuffer dst )

-Eero