Closed DanialPhanToM closed 1 year ago
@DanialPhanToM
I've made it working for me with work around
_socketIo.ConnectAsync();
var connectionAttemptsCount = (int)_socketIo.Options.ConnectionTimeout.TotalSeconds * 20;
for (var counter = 0; counter < connectionAttemptsCount; counter++)
{
if (connectionAttemptsCount == counter)
{
OnError?.Invoke(this, "Could not establish socket connection.");
return false;
}
if (_socketIo.Connected)
{
return true;
}
Thread.Sleep(50);
}
I got some data
Hi! how did you solve it?
Hi! how did you solve it?
Hey there;
I suppose you mean the whole thing and not the specific socket that I was using. I actually don't know what the problem was, I rewrote basically the same code on .NET 6.0 and it just worked with no problem.
and if you meant the socket that I was using, it turned out they had some changes to how it's meant to be used (needed emiting some data)
also you can add Reconnection = false
in your options to help with debugging and see what's goin wrong
EDIT: so if you look at #300 there seems to be a problem with .Net 4.0 when you add ExtraHeaders
. So that could be your problem as well.
The following code doesn't work, however the equivalent in JS works with no problem. It's a v2.x server and I'm using EIO 3. The client simple doesn't connect. C# code:
Equivalent in JS: