NullReferenceException when connect
Posted: 18 Mar 2013, 02:03
Hi~ Lapo:
I got a NullReferenceException when smart fox do connect().
We want to simulate wifi disconnection because of some unknown problem.
Test 1:
step1: unplug the network line. ( simulation about wifi network disconnecting )
step2: do Connect(), this will get two warnings:
TCPSocketLayer: Connection error: No route to host 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.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0
Connection error: No route to host 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.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0 ==> HostUnreachable
Step3: do Connect() again, then will get this NullReferenceException error:
NullReferenceException: Object reference not set to an instance of an object
Sfs2X.Bitswarm.BitSwarmClient.Connect (System.String ip, Int32 port)
Sfs2X.SmartFox.Connect (System.String host, Int32 port)
Test 2:
Step1: do Connect(), and wait for connection success.
Step2: unplug the network line
Step3: wait for a long time, then do Disconnect();
Step4: do Connect(), will get the NullReferenceException error, too.
ps. smartfox dll: v1.1.0, macOSX: 10.6.8, unity3d: 3.5.7f6
I got a NullReferenceException when smart fox do connect().
We want to simulate wifi disconnection because of some unknown problem.
Test 1:
step1: unplug the network line. ( simulation about wifi network disconnecting )
step2: do Connect(), this will get two warnings:
TCPSocketLayer: Connection error: No route to host 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.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0
Connection error: No route to host 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.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0 ==> HostUnreachable
Step3: do Connect() again, then will get this NullReferenceException error:
NullReferenceException: Object reference not set to an instance of an object
Sfs2X.Bitswarm.BitSwarmClient.Connect (System.String ip, Int32 port)
Sfs2X.SmartFox.Connect (System.String host, Int32 port)
Test 2:
Step1: do Connect(), and wait for connection success.
Step2: unplug the network line
Step3: wait for a long time, then do Disconnect();
Step4: do Connect(), will get the NullReferenceException error, too.
ps. smartfox dll: v1.1.0, macOSX: 10.6.8, unity3d: 3.5.7f6