2 Replies - 1325 Views - Last Post: 06 August 2009 - 10:04 AM Rate Topic: -----

#1 JBroms  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 18-April 09

Sockets and stuff

Post icon  Posted 03 August 2009 - 09:38 PM

Hi, I was just wondering if there was a way to determine if a Socket is still open.

Am I on a wild goose chase or does such a method exist?
Is This A Good Question/Topic? 0
  • +

Replies To: Sockets and stuff

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1148
  • View blog
  • Posts: 7,149
  • Joined: 07-September 06

Re: Sockets and stuff

Posted 03 August 2009 - 10:44 PM

I believe you will recieve a message (event will fire) when a socket is closed, at least that is how Python and Actionscript work... If not you can always attempt to send a message to the socket, if it times out/ errors out you know that the socket is no longer connected.
Was This Post Helpful? 0
  • +
  • -

#3 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 906
  • View blog
  • Posts: 3,170
  • Joined: 12-May 09

Re: Sockets and stuff

Posted 06 August 2009 - 10:04 AM

I couldn't find a method to see if a Socket is closed in the API. It does raise an exception if it's closed, so you could use that by created a begin block around your code, trying the actions you would normally do, and rescuing the IOError if it's closed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1