Close (Socket function)

From m204wiki
Revision as of 19:33, 8 November 2011 by 198.242.244.47 (talk) (Created page with " <span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span> Close function <p> <var>Close</var> is a member of the <var>[[Sock...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<section begin=dpl_desc/><section end=dpl_desc/>

Close is a member of the Socket class.

This method terminates the sending and receiving of data on, and removes from use, a Janus Sockets connection. The Close method, which may be invoked with a Call statement, has an effect similar to its equivalent $function, $Sock_Close.

Syntax

[%conn =] %socko:Close

Syntax terms

%conn If specified, this is a numeric variable to contain the returned value 1 from Close, indicating the connection is closed.
%socko A variable or an expression that is a reference to a Socket object.

Usage notes

  • In addition to closing the socket, the Close method destroys (discards) the object.
  • Close is not affected by any ONRESET setting. If the socket for which it is invoked is in the RESET state, Close continues to the next statement and does not set the last socket error information.

Example

The Close call signals that the program has completed all processing on the %sok socket:

%sok:Close