ctx.setKeyRegistrationState(KeyRegistrationState.CANCEL);
return false;
}
WorkerThread workerThread = (WorkerThread) Thread.currentThread();
// Re-size the ByteBuffer based on the underlying OS buffer.
if (workerThread.getByteBuffer().capacity() != bufferSize) {
if (receiveBufferSizeInBytes <= 0) {
try {
if (ctx.getProtocol() == Protocol.TCP) {
bufferSize = ((SocketChannel) channel).socket().
getReceiveBufferSize();
} else {
bufferSize = ((DatagramChannel) channel).socket().
getReceiveBufferSize();
}
} catch (IOException ex) {
if (logger.isLoggable(Level.WARNING)) {
logger.log(Level.WARNING,
"sip.stack.network.resize_buffer_failed_bad_Socket_state");
logger.log(Level.WARNING, ex.getMessage(), ex);
}
bufferSize = DEFAULT_RECEIVE_BB_SIZE;
}
} else {
bufferSize = receiveBufferSizeInBytes;
}
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "sip.stack.network.receivee_buffer",
bufferSize);
}
workerThread.setByteBuffer(ByteBuffer.allocate(bufferSize));
}
boolean invokeNextFilter = super.execute(ctx);
if (!invokeNextFilter) {