You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
privatevoidListener_ConnectionRequestEvent(ConnectionRequestrequest){Logger.Information($"Incoming connection from {request.RemoteEndPoint}");if(Server.ConnectedPeersCount<1337)request.AcceptIfKey($"{Id}/HUB");elserequest.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
The text was updated successfully, but these errors were encountered:
RevenantX
changed the title
Cant accept connections
Cant accept connections with UnsyncedEvents enabled
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.
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
The text was updated successfully, but these errors were encountered: