Closed BrianARice closed 3 years ago
I have successfully connected to a server that sends streaming price information and I am receiving messages.
However, it seems to timeout every time after 30 seconds and disconnects.
I have tried to set the timeouts to be ignored with pipeline.AddLast(new IdleStateHandler(0, 0, 0));
In the DotNetty function FinishRead, it eventually gets to this code with a LastBytesRead of -1 and this ultimately seems to close the channel...
allocHandle.LastBytesRead = ch.DoReadBytes(byteBuf); if (allocHandle.LastBytesRead <= 0) { // nothing was read -> release the buffer. byteBuf.Release(); byteBuf = null; close = allocHandle.LastBytesRead < 0; break; }
Ok... so the IdleStateHandler was the problem... I needed to set the write idle timeout to some reasonable value (say 1) in order for the system to send out heartbeat packets.
I have successfully connected to a server that sends streaming price information and I am receiving messages.
However, it seems to timeout every time after 30 seconds and disconnects.
I have tried to set the timeouts to be ignored with pipeline.AddLast(new IdleStateHandler(0, 0, 0));
In the DotNetty function FinishRead, it eventually gets to this code with a LastBytesRead of -1 and this ultimately seems to close the channel...