Slick Forums

Discuss the Slick 2D Library
It is currently Wed Jun 19, 2013 12:52 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Jun 18, 2012 8:26 pm 
Offline

Joined: Sun Jun 03, 2012 1:47 pm
Posts: 5
Hi,

My game has the issue where if the player accidentally closes the browser, the kryonet socket will still be in use, so if the same user tries to make another connection through kryonet the game will crash with a 'address in use' error.

Is there anyway of fixing this?

Thanks,


Top
 Profile  
 
PostPosted: Mon Jun 18, 2012 10:02 pm 
Offline
Regular
User avatar

Joined: Thu May 05, 2011 8:35 pm
Posts: 231
Location: Somewhere between the bits and bytes
Hi, I don't know a fix for this, but i know why the socket is still in use.
The instance of the jvm used for the applet is most likely still running, and therefore still using the socket.

Maybe there is some way of detecting, whether the applet is still displaying, and then close it properly, if it isn't?

_________________
For every new problem, a new source of solutions has come to exist.


Top
 Profile  
 
PostPosted: Thu Jul 05, 2012 2:16 pm 
Offline

Joined: Wed Feb 15, 2012 10:17 am
Posts: 11
Are you handling the disconnects properly?

Code:
server.addListener(new Listener() {
   /*
    * received Runs upon recieving data
    */
   public void received(Connection c, Object object)
   {
      //Handle data
   }

   /*
    * disconnected Runs upon disconnection of the client.
    */
   public void disconnected(Connection c) {
      //remove client
   }

});


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group