C#C
C#3y ago
13 replies
MeGaLoDoN

I need help debugging c# event-based reliable UDP implementation.

Note: I know that there are libraries that can do this and even more. But for my own reasons, I want to have full control of my code, and it is already almost done and supposed to work, I just have 1 bug.

Here is code: https://pastebin.com/dXx6WPG9

Basically, OnConnectionRequest gets called correctly on the server. Then I call request.Accept, but client never receives a response and connection result is false, so OnConnected never gets called. This is not only with accept message - I tried sending a lot different messages from server to client, but client never receives any message, although server always receives messages from the client. The client is always stuck on:
var msg = await _client.ReceiveAsync(token); in CheckForMessages.
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Was this page helpful?