Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Socket Problems with Linux and Applets  RSS feed

 
Shaun Brierly
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greets,
I have a problem where a java applet connects to the machine it came from through a socket. Everything works fine except when the user presses the reload button. This works under windows, but when using Linux, whether it's browser or AppletViewer, the socket is already in use. Anyone know a work around for this?.. I have the connections close in the destroy() method of the applet. Thanks in advance
Shaun.
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just close connection in close() instead of destroy(). Because sometimes destroy is not close by all browsers.
Thanks,
Angela
 
Shaun Brierly
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply, I looked further into it. There are actually two connections. One is a regular socket, and the other is a datagramsocket which passes UDP packets. They're both closed at the same point in the program. It seems to be some conflict with the DatagramSocket class and linux, because once again, it works in windows, but not linux. So still have the same problem, where when someone refreshes the browser, or reloads in Appletviewer it gives the Address already in use exception.
Shaun.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!