_CONNECTED

From QB64 Wiki
Revision as of 00:39, 20 April 2020 by Odin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The _CONNECTED function returns the status of a TCP/IP connection handle.


Syntax

result& = _CONNECTED(connectionHandle&)


Description

  • The handle can come from the _OPENHOST, OPENCLIENT or _OPENCONNECTION QB64 TCP/IP functions.
  • Returns -1 if still connected or 0 if connection has ended/failed.
  • Do not rely solely on this function to check for ending communication.
  • Use "time-out" checking as well and CLOSE any suspect connections.
  • If this function indicates the handle is not connected, any unread messages can still be read using GET #.
  • Even if this function indicates the handle is not connected, it is important to CLOSE the connection anyway or important resources cannot be reallocated.

See also



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page