$Sock Num: Difference between revisions
m (1 revision) |
(Automatically generated page update) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Sock_Num}} | {{DISPLAYTITLE:$Sock_Num}} | ||
<span class="pageSubtitle">Get selected socket numbers</span> | <span class="pageSubtitle">Get selected socket numbers</span> | ||
<p class=" | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented | ||
methods. | methods. The OO equivalent for <var>$Sock_Num</var> is the <var>[[Num (Socket function)|Num]]</var> method.</p> | ||
<var>$Sock_Num</var> retrieves selected socket numbers. | <var>$Sock_Num</var> retrieves selected socket numbers. |
Latest revision as of 00:00, 21 September 2018
Get selected socket numbers
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for $Sock_Num is the Num method.
$Sock_Num retrieves selected socket numbers.
Syntax
%nums = $Sock_Num[([selection])]
Syntax terms
%nums | A string that contains blank-separated selected socket numbers in ascending order. | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
selection | A string that identifies which socket numbers to return. It is any combination of the following strings separated by OR, and each optionally prefixed by NOT:
If NOT prefixes one of the above specifications, then all in-use sockets (excluding the specified set) are included in the selected set. With multiple terms separated by OR, the specified sets are combined by the set union operation. |
Usage notes
$Sock_Num does not have a socket number argument, and thus it is not affected by any ONRESET setting.
Examples
- In the following example,
%sock
contains the blank-delimited values of%c1
and%c2
. Assuming no other client socket numbers were in use, this would result in%sock = '2 3'
.JANUS DEFINE PIPE * CLSOCK 5 REMOTE * * SOCKPMAX 2 Begin %c1 is Float %c2 is Float %sock is String Len 255 %c1 = $Sock_conn('PIPE', 'www.ampas.org', 80) %c2 = $Sock_conn('PIPE', 'www.wga.org', 80) %sock = $Sock_Num ...
- The following example shows another way to retrieve the list of all
OPEN
socket numbers:%sock = $Sock_Num('NOT RESET')
- The following example shows how to retrieve the list of all
OPEN
socket numbers that have not received the FIN indicator:%sock = $Sock_Num('CONN OR FINS')