CONNECTED: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:_CONNECTED}} The _CONNECTED function returns the status of a TCP/IP connection handle. {{PageSyntax}} :{{Parameter|result&}} = _CONNECTED({{Parameter|connectionHandle&}}) {{PageDescription}} * 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 "...")
 
m (Protected "CONNECTED" ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)))
(No difference)

Revision as of 16:11, 4 May 2022

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:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link