Event e = null;
do { // loop until we get a valid packet, drop bad ones.
sock.receive(pkt);
ByteBuffer bb = ByteBuffer.wrap(buf, 0, pkt.getLength());
ByteBufferInputStream bbis = new ByteBufferInputStream(bb);
DataInputStream in = new DataInputStream(bbis);
try {
e = SyslogWireExtractor.extractEvent(in);
} catch (EventExtractException ex) {
rejects++;