LagMonitor: NullPointerException when LostConnection

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

hhd90
Posts: 67
Joined: 21 Dec 2012, 05:17

LagMonitor: NullPointerException when LostConnection

Postby hhd90 » 04 Nov 2014, 09:08

My client use the LagMonitor to tracking latency of the connection. But when LostConnection event was dispatched, my client thrown a exception:
11-04 15:06:21.370: E/AndroidRuntime(19759): FATAL EXCEPTION: Timer-2
11-04 15:06:21.370: E/AndroidRuntime(19759): java.lang.NullPointerException
11-04 15:06:21.370: E/AndroidRuntime(19759): at sfs2x.client.core.sockets.TCPSocketLayer.writeSocket(TCPSocketLayer.java:182)
11-04 15:06:21.370: E/AndroidRuntime(19759): at sfs2x.client.core.sockets.TCPSocketLayer.write(TCPSocketLayer.java:303)
11-04 15:06:21.370: E/AndroidRuntime(19759): at sfs2x.client.core.SFSIOHandler.writeTCP(SFSIOHandler.java:426)
11-04 15:06:21.370: E/AndroidRuntime(19759): at sfs2x.client.core.SFSIOHandler.onDataWrite(SFSIOHandler.java:420)
11-04 15:06:21.370: E/AndroidRuntime(19759): at sfs2x.client.core.SFSProtocolCodec.onPacketWrite(SFSProtocolCodec.java:79)
11-04 15:06:21.370: E/AndroidRuntime(19759): at sfs2x.client.bitswarm.BitSwarmClient.send(BitSwarmClient.java:234)
11-04 15:06:21.370: E/AndroidRuntime(19759): at sfs2x.client.SmartFox.send(SmartFox.java:1026)
11-04 15:06:21.370: E/AndroidRuntime(19759): at sfs2x.client.util.LagMonitor$PollTimerTask.run(LagMonitor.java:107)
11-04 15:06:21.370: E/AndroidRuntime(19759): at java.util.Timer$TimerImpl.run(Timer.java:284)
How do catch this exception?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: LagMonitor: NullPointerException when LostConnection

Postby Lapo » 04 Nov 2014, 10:23

Hi,
we just released an update of the API with this fix.

See here:
viewtopic.php?f=22&t=17535&p=76078#p76078

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
hhd90
Posts: 67
Joined: 21 Dec 2012, 05:17

Re: LagMonitor: NullPointerException when LostConnection

Postby hhd90 » 05 Nov 2014, 04:07

Ok, thanks!

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 23 guests