lidgren / lidgren-network-gen3

Lidgren Network Library
https://groups.google.com/forum/#!forum/lidgren-network-gen3
MIT License
1.19k stars 331 forks source link

Update NetPeer.cs #47

Closed AgentFire closed 9 years ago

AgentFire commented 9 years ago

Temporary fix when WaitMessage(int) method could return null. (Have been happening to me.)

lidgren commented 9 years ago

This is as designed. If a message has not arrived within "maxMillis", this method will return null. Looping until a message is found would violate the maxMillis argument.

AgentFire commented 9 years ago

@lidgren Then we should return null when WaitOne returns false, and loop when it returns true, because I have experienced null returns by ReadMessage after TRUE value returned by WaitOne(int). Could you respond, please?