This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

sockets and garbage collection ...

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have developed a server application that can accept one connection at a time. One of the server options is that the client can request to chat with the server.If this is the case, the the server opens a chat window which uses another class 'chatserver' in order to wait for and accept connection. However, i found out that if the user on the server closes the ChatGui of the server (maybe because they finished chatting) and they reopen it after about 4 minutes a bind exception will be thrown. After testing i found out that the Gui is disposed but the serversocket still waits and accepts connections while another gui opens and tries to bind the same port. i have a cleanup method that closes I/O streams and closes the serversocket and socket objects as well.
Does anyone have anyidea how to force the server socket release the specific port?
Thank you in advance.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic