1
1
Fork 0
mirror of https://github.com/DualBrain/QB64.git synced 2023-11-19 13:10:13 +00:00
QB64-website/wiki/_CONNECTED.md
2022-12-24 21:14:48 -06:00

1 KiB

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 (TCP/IP statement).
  • 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