开发者

Why aren't all packets sent to the client?

I'm writing a simple proxy (more a packet logger) for an开发者_如何学编程 online game in C#. All the packets get received by the proxy but some aren't sent to the client (not sure about the server). For example:

Client->Server: Login Packet - My proxy receives the packet, displays it and sends it to the server.

Server->Client: Connected! Packet - My proxy again receives the packet, it also displays it and sends it to the client.

Server->Client: Chat channels packet - My proxy again receives the packet, it also displays it but the client doesn't receive it. There is no exception.

My code: http://lesderid.pastebin.com/Km7vT2jF

(This is the same project as here: Why can't I send to the listening socket anymore?)


This is just from a brief reading of the code:

  1. Do not bind to 127.0.0.1. Bind to IPAddress.Any instead.
  2. OnDataReceivedFromServer needs to call EndReceive.
  3. I don't recommend mixing synchronous (Send) and asynchronous (BeginReceive) operations on the same socket.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜