synchronized protected void xnTcpSetPendingPackets(int s){
  pendingPackets+=s;
  if (pendingPackets < 0) {
    pendingPackets=0;
  }
}

synchronized protected void xnTcpSetPendingPackets ( int s ) { pendingPackets += s ; if ( pendingPackets < 0 ) { pendingPackets = 0 ; } }
tcp / ip stack and the xntcp interface provide enough buffering to avoid overrun . however , queueing commands faster than they can be processed should in general be avoided . to this purpose , a counter is incremented each time a packet is queued and decremented when a reply from the interface is received . when the counter reaches the pre - defined maximum ( e . g . 15 ) queuing of commands is blocked . owing to broadcasts from the command station , the number of commands received can actually be higher than that of commands sent , but this fact simply implies that we may have a higher number of pending commands for a while , without any negative consequence ( the maximum is however arbitrary ) .
