chronoxor / NetCoreServer

Ultra fast and low latency asynchronous socket server & client C# .NET Core library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
https://chronoxor.github.io/NetCoreServer
MIT License
2.63k stars 550 forks source link

OnDisconnected without OnConnected? #272

Open jkuek opened 11 months ago

jkuek commented 11 months ago

My app (using NetCoreServer) is running on an EC2 instance behind a network load balancer (across 3 availability zones).

I'm seeing regular TcpSession.OnDisconnected() and TcpServer.OnDisconnected() events without the corresponding OnConnected() events, and have confirmed these events are triggered by the health checks on my target group.

Why is this happening? I expected an OnConnected() to always precede OnDisconnected().

TailyFair commented 6 months ago

@jkuek Which version are you using?

jkuek commented 6 months ago

@TailyFair I've just updated to 8.0.7 and can confirm the issue still occurs.

When my normal clients are connecting, everything works as expected. However, the health check connections only generate the OnDisconnecting/OnDisconnected events (no OnConnected event). I'm guessing this is because the connections are likely super short in duration.

image