isConnection()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

isConnection()

Post by Tranquil »

Hello Forum.

For every object, there is an is....() command. Is there a reason why not implementing an IsConnection() command for checking if the connectionID is still valid?
Tranquil
User avatar
RichAlgeni
Addict
Addict
Posts: 935
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: isConnection()

Post by RichAlgeni »

With sockets, there is no guarantee that a socket is still connected unless data is actually sent. This is true even with a local connection. The command could return a false positive. If you have a connection that you really need to know when it goes down, you could write a simple heartbeat procedure.
Post Reply