_socket.receive(packet);
if (packet.getAddress().equals(_router.getOrigAddress()))
continue;
Message message = new Message(packet.getData(), packet.getLength());
Short seqno = message.getSeqno();
if (message.getMsgType() == Message.HELLO)
message.setOrigAddress(packet.getAddress());
if (!_receivedSet.contains(message.getOrigAddress(), seqno) && !message.getOrigAddress().equals(_origAddress)){
StringBuffer txt = new StringBuffer("Received ");
txt.append(message.toString());
_logger.info(txt.toString());
_receivedSet.add(new ReceivedTuple(message.getOrigAddress(), seqno));
if (message.getMsgType() == Message.HELLO)
_router.processHello(message);
else if (message.getMsgType() == Message.TC)
_router.processTc(message);
}
} catch (Exception e) {
_logger.warning("Error parsing packet");
e.printStackTrace();