Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant accept connections with UnsyncedEvents enabled #369

Closed
aizuon opened this issue May 20, 2020 · 4 comments
Closed

Cant accept connections with UnsyncedEvents enabled #369

aizuon opened this issue May 20, 2020 · 4 comments
Assignees
Labels

Comments

@aizuon
Copy link

aizuon commented May 20, 2020

Can't accept incoming connections on netcore 3.1 server. Same code used to work before when server was a Unity project.

edit: Disabling UnsyncedEvents fixes the issue.

private void Listener_ConnectionRequestEvent(ConnectionRequest request)
{
    Logger.Information($"Incoming connection from {request.RemoteEndPoint}");
    if (Server.ConnectedPeersCount < 1337)
        request.AcceptIfKey($"{Id}/HUB");
    else
        request.Reject();
}

Using AcceptIfKey or Accept doesn't matter, I always get the same exception

exception:
System.Threading.LockRecursionException
HResult=0x80131500
Message=Recursive upgradeable lock acquisitions not allowed in this mode.
Source=System.Private.CoreLib
StackTrace:
at System.Threading.ReaderWriterLockSlim.TryEnterUpgradeableReadLockCore(TimeoutTracker timeout)
at System.Threading.ReaderWriterLockSlim.EnterUpgradeableReadLock()
at LiteNetLib.NetManager.OnConnectionSolved(ConnectionRequest request, Byte[] rejectData, Int32 start, Int32 length)
at LiteNetLib.ConnectionRequest.AcceptIfKey(String key)
at Zin.Hub.Networking.HubServer.Listener_ConnectionRequestEvent(ConnectionRequest request) in C:\Users\dorq\source\repos\zin\Server\Zin.Hub\Networking\HubServer.cs:line 84
at LiteNetLib.EventBasedNetListener.LiteNetLib.INetEventListener.OnConnectionRequest(ConnectionRequest request)
at LiteNetLib.NetManager.ProcessEvent(NetEvent evt)
at LiteNetLib.NetManager.CreateEvent(EType type, NetPeer peer, IPEndPoint remoteEndPoint, SocketError errorCode, Int32 latency, DisconnectReason disconnectReason, ConnectionRequest connectionRequest, DeliveryMethod deliveryMethod, NetPacket readerSource, Object userData)
at LiteNetLib.NetManager.ProcessConnectRequest(IPEndPoint remoteEndPoint, NetPeer netPeer, NetConnectRequestPacket connRequest)
at LiteNetLib.NetManager.DataReceived(Byte[] reusableBuffer, Int32 count, IPEndPoint remoteEndPoint)
at LiteNetLib.NetManager.LiteNetLib.INetSocketListener.OnMessageReceived(Byte[] data, Int32 length, SocketError errorCode, IPEndPoint remoteEndPoint)

Library version: commit 0e5880b on client, 0.9.2.2 on server

Framework: Unity on client, netcore 3.1 on server

OS: Windows

@RevenantX RevenantX changed the title Cant accept connections Cant accept connections with UnsyncedEvents enabled May 20, 2020
@RevenantX RevenantX added the bug label May 20, 2020
@RevenantX RevenantX self-assigned this May 20, 2020
@tylerohlsen
Copy link

@RevenantX I'm running into the same issue. Why was this closed? Disabling UnsyncedEvents is only a workaround, not a fix.

@RevenantX
Copy link
Owner

@tylerohlsen "closed this in d3ee215 on May 20" because it's fixed in master branch.

@tylerohlsen
Copy link

@RevenantX awesome, thanks for the confirmation! Do you have a plan for when the next nuget release will be?

@RevenantX
Copy link
Owner

@tylerohlsen no, but maybe soon after some mini improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants