I'm having a little problem,
I use BinaryWriter
to write the bytes and then be sent as a response
surely I use it right (I think).
However, when I use it several times, I give breakpoint or capture the answers by WireShark , looking at the answers it returns me (Writing)
and it seems like BinaryWriter
is joining every time I write and then I send the answer.
I'll give you a basic example of the code the way I use it:
Response.Write(new byte[] { 0x0F, 0x00, 0x00 }); //chamada da classe é Response
Response.WritePStr(UserInfo.Username); //Escreve String e converte em bytes
SendResponse(); //copia os bytes escritos da PangyaBinaryWriter, usando o Response
Response.Write(new byte[] { 0x01, 0x00, 0xD9, 0xFF, 0xFF, 0xFF, 0xFF });
SendResponse();
If I leave it this way it "seems" to put everything together and sends it back, and sometimes it sends everything apart, but it's hard to do that. my problem is this, is there any way to "cut" or "separate" for each individual answer?
Code is here: