barebones-masterserver icon indicating copy to clipboard operation
barebones-masterserver copied to clipboard

ConnectionToMaster (Automation) causes Unity Freeze

Open shubhank008 opened this issue 8 years ago • 3 comments

As title says, I am using default ConnectionToMaster script provided with MSF to Auto-Connect to the MasterServer, with minTime=1, maxTime=5 and timeConnect=2
But, it is causing the Unity's GameBuild (not editor but actual Build) to freeze for a few second(s). From what I can grasp, it seems the freeze happens exactly at the same moment when MSF detects that MasterServer is not online. The freeze is happening exactly the moment the following appears in console log:

<i>WindowsPlayer()</i> 1/4/2018 8:05:31 AM|Fatal|WebSocket.connect:0|System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it.
                          
                            at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
                            at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
                            at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0 
                            at System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress[] ipAddresses, Int32 port) [0x00000] in <filename unknown>:0 

PS: The MasterServer (separate/external) is not running intentionally as I was trying to detect and check what happens if server is down and a few failsafe scenarios, I hope this freeze is not the intended behavior.

shubhank008 avatar Jan 04 '18 02:01 shubhank008

Related to #142 #145 and #148 . The #142 offers a solution to this, but requires assistance

joaoborks avatar Jan 04 '18 16:01 joaoborks

I am trying a few patchy fixes to go around the connect() issue but first checking if server is online/accessible and only then trying to connect. Will update if works.

shubhank008 avatar Jan 04 '18 16:01 shubhank008

my problem is after two day master runs on linux, then I can not connect from my device, master still runs but the port is closed and showing console AM|Fatal|WebSocket.connect:0|System.Net.Sockets.SocketException: Connection refused at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in :0 at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in :0 at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in :0 at System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress[] ipAddresses, Int32 port) [0x00000] in :0 is there anybody know what's problem ??

thientvimo avatar Oct 30 '18 11:10 thientvimo