requesting disconnect() throws exception

Post here all your questions related with SmartFoxServer Java API

Moderators: Lapo, Bax

ibb
Posts: 3
Joined: 30 Apr 2012, 18:39

requesting disconnect() throws exception

Postby ibb » 30 Apr 2012, 18:46

when im using disconnect(), exception is thrown:


Code: Select all

04-30 21:35:24.965: W/SmartFoxClient(23013): Socket Error: Could not close session! (already connected?)
04-30 21:35:24.965: W/SmartFoxClient(23013): java.lang.Exception: Could not close session! (already connected?)
04-30 21:35:24.965: W/SmartFoxClient(23013):    at it.gotoandplay.utils.net.xmlsocket.XMLSocket.close(XMLSocket.java:88)
04-30 21:35:24.965: W/SmartFoxClient(23013):    at it.gotoandplay.smartfoxclient.SmartFoxClient.disconnect(SmartFoxClient.java:1252)
04-30 21:35:24.965: W/SmartFoxClient(23013):    at com.diwip.connection.sfs.Connection$3.run(Connection.java:357)
04-30 21:35:24.965: W/SmartFoxClient(23013):    at java.lang.Thread.run(Thread.java:1019)


The questions:
1) is it possible to close the socket connection?
2) if not, can i prevent onConnection event being fired?

Thanks!
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: requesting disconnect() throws exception

Postby rjgtav » 30 Apr 2012, 18:55

Hello.
Are you using the latest version located at http://smartfoxserver.com/download/sfsPro#p=updates ?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
ibb
Posts: 3
Joined: 30 Apr 2012, 18:39

Re: requesting disconnect() throws exception

Postby ibb » 01 May 2012, 10:11

Hello rjgtav

Yes, i do.
To avoid reconnection via bluebox, before disconnecting, i change the smartConnect flag to false.
In this case no reconnection occurs via bluebox.

PS
Is is possible to know what kind of exception is thrown when closing socket is failed, so i will be able to ignore it? (in android sfs api)
ibb
Posts: 3
Joined: 30 Apr 2012, 18:39

Re: requesting disconnect() throws exception

Postby ibb » 01 May 2012, 15:58


Return to “Java2SE / Android Client API”

Who is online

Users browsing this forum: No registered users and 2 guests