DotNetty icon indicating copy to clipboard operation
DotNetty copied to clipboard

Cant send 2 Ibytebuffers to channel.writeasnycflush(message)

Open amandania opened this issue 4 years ago • 2 comments

So i try to call this on the server back to back for example

senpacket(buf1) sendpacket(buf2)

when i throw a break-point in debug mode on sendpacket2 it gets sent and I receive it on the client end but without the breakpoint, I never receive the second packet at all. Client only ever reads 1 opcode to handle when there is no break-point...

any ideas on what the issue can be? I'm not sure what kind of code ot paste for reference

amandania avatar Oct 19 '19 18:10 amandania

 public void SendPacket(IOutGoingPackets packet)
        {
            var buffer = Unpooled.Buffer();
            buffer.WriteInt((int)packet.PacketType);
            buffer.WriteBytes(packet.GetPacket().Array);

            WriteToChannel(buffer);
        }


        private void WriteToChannel(IByteBuffer data)
        {
                _channel.WriteAndFlushAsync(data);
        }

amandania avatar Oct 19 '19 19:10 amandania

I've tried to make the functions tasks and wait for each but it did nothing

amandania avatar Oct 19 '19 19:10 amandania