コード例 #1
0
 @Override
 public void messageReceived(ChannelMessage msg) {
   if (!okToProcess(msg.getOptions())) {
     super.messageReceived(msg);
     return;
   }
   int msgnr =
       XByteBuffer.toInt(msg.getMessage().getBytesDirect(), msg.getMessage().getLength() - 4);
   msg.getMessage().trim(4);
   MessageOrder order = new MessageOrder(msgnr, (ChannelMessage) msg.deepclone());
   try {
     inLock.writeLock().lock();
     if (processIncoming(order)) processLeftOvers(msg.getAddress(), false);
   } finally {
     inLock.writeLock().unlock();
   }
 }
コード例 #2
0
 public int getNumber() {
   if (!hasNr) return -1;
   return XByteBuffer.toInt(this.data, 0);
 }