@Override
protected void readSocket() throws Exception
{
final DatagramSocket s = checkSocket();
// TODO allow buffer size to be specified.
final FlexBuffer buf = new FlexBuffer( new byte[8192] );
final DatagramPacket p = new DatagramPacket( new byte[0], 0 );
try
{
while (isStarted())
{
p.setData( buf.getBuf() );
s.receive( p );
buf.setIndex( 0 );
buf.setLength( p.getLength() );
if (s.isConnected())
session.sessionPacket( null, buf );
else
session.sessionPacket( getWho( p.getAddress(), p.getPort() ), buf );