Ejemplo n.º 1
0
 /** Releases the channels. */
 private void freeChannels() {
   for (ChannelInfo info : channels.values()) {
     freePacket(info.getReadPacket());
     freePacket(info.getWritePacket());
   }
   channels.clear();
 }
Ejemplo n.º 2
0
 /**
  * Setter for last read packet.
  *
  * @param channelId Channel id
  * @param packet Packet
  */
 public void setLastReadPacket(int channelId, Packet packet) {
   final ChannelInfo info = getChannelInfo(channelId);
   // grab last packet
   Packet prevPacket = info.getReadPacket();
   // set new one
   info.setReadPacket(packet);
   // free the previous packet
   freePacket(prevPacket);
 }