any idea why a tcp connection might spam 0's indefinitely?
turns out i failed to count the bytes properly and couldn't realize it until I complain! oof.
loving gnet btw nice work :thumbsup:
just see this message and glad you've worked it out.
the notifications from gitter seem to be a bit belated, I would find a way to solve this problem.
The problem came back so I rolled back my changes and confirmed they caused it. The culprit:
it's a bit hard to figure out the root cause based on this code snippet, maybe provide the whole codec?
sorry, nothing to do with gnet actually. I am using a bufio.Reader to read from a net.TCPConn. I call Peek(4)/Discard(4) to read how many bytes there are, then Peek(1)/Discard(1) until all those bytes are read. If I changed the second operation to ReadByte() then even after all the bytes are read any peek/read finds a 0 in the buffer indefinitely, as opposed to nothing like it did before. I thought I was actually spamming the stream with zeroes (with gnet server) but as soon as i put it back to Peek(1)/Discard(1) the problem went away.