Skip to content
Snippets Groups Projects
Commit 7ae94f60 authored by Stefan Glaser's avatar Stefan Glaser
Browse files

Process TCP-NO-DELAY option for incoming subscriber connections.

* Check incoming subscriber connection requests for the TCP-NO-DELAY header field and set the TCP-NO-DELAY option on the corresponding channel accordingly.
parent ba3dd3e6
No related branches found
No related tags found
No related merge requests found
......@@ -96,6 +96,10 @@ public class TcpServerHandshakeHandler extends SimpleChannelHandler {
DefaultPublisher<?> publisher = topicParticipantManager.getPublisher(topicName);
ChannelBuffer outgoingBuffer = publisher.finishHandshake(incomingConnectionHeader);
Channel channel = ctx.getChannel();
if (incomingConnectionHeader.hasField(ConnectionHeaderFields.TCP_NODELAY)) {
boolean tcpNoDelay = "1".equals(incomingConnectionHeader.getField(ConnectionHeaderFields.TCP_NODELAY));
channel.getConfig().setOption("tcpNoDelay", tcpNoDelay);
}
ChannelFuture future = channel.write(outgoingBuffer).await();
if (!future.isSuccess()) {
throw new RosRuntimeException(future.getCause());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment