help! client cannot connect server when peercount = 370.
hom_king
✭
and throw error from Photon.SocketServer.Peers.ManagedPeer
ERROR Photon.SocketServer.Peers.ManagedPeer [(null)] - System.IndexOutOfRangeException
在 System.Collections.Generic.Dictionary`2.Resize(Int32 newSize, Boolean forceNewHashCodes)
在 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
在 Joy1ServerGame.Application.CreatePeer(InitRequest initRequest) 位置 C:\works\qinpengfangpaofa\vsprojects\Joy1ServerGame\Joy1ServerGame\Application.cs:行号 81
在 Photon.SocketServer.Peers.ManagedPeer.CreatePeerBase(InitRequest initRequest) 位置 h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Peers\ManagedPeer.cs:行号 189
ERROR Photon.SocketServer.Peers.ManagedPeer [(null)] - System.IndexOutOfRangeException
在 System.Collections.Generic.Dictionary`2.Resize(Int32 newSize, Boolean forceNewHashCodes)
在 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
在 Joy1ServerGame.Application.CreatePeer(InitRequest initRequest) 位置 C:\works\qinpengfangpaofa\vsprojects\Joy1ServerGame\Joy1ServerGame\Application.cs:行号 81
在 Photon.SocketServer.Peers.ManagedPeer.CreatePeerBase(InitRequest initRequest) 位置 h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Peers\ManagedPeer.cs:行号 189
0
Best Answer
-
error is thrown from your code. you insert into dictionary in method Application.CreatePeer. this insertion fails because CreatePeer might be called concurently. so you need to lock your dictionary before insert5
Answers
-
error is thrown from your code. you insert into dictionary in method Application.CreatePeer. this insertion fails because CreatePeer might be called concurently. so you need to lock your dictionary before insert5