Info (Socket function): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 13: | Line 13: | ||
<td>A string variable to contain the returned information. | <td>A string variable to contain the returned information. | ||
</td></tr> | </td></tr> | ||
<tr><th> | <tr><th>socket</th> | ||
<td>A variable or an expression that is a reference to a <var>Socket</var> object. | <td>A variable or an expression that is a reference to a <var>Socket</var> object. | ||
</td></tr> | </td></tr> | ||
Line 43: | Line 43: | ||
Since the status of <var>OPEN</var> sockets may include several more status types in future releases, | Since the status of <var>OPEN</var> sockets may include several more status types in future releases, | ||
test for <var>OPEN</var> sockets by testing for the string <code>RESET</code>: | test for <var>OPEN</var> sockets by testing for the string <code>RESET</code>: | ||
<p class="code">If | <p class="code">If socket:Info('STATUS') ne 'RESET' ... | ||
</p> </td></tr> | </p> </td></tr> | ||
<tr><th>opt </th> | <tr><th>opt </th> |
Revision as of 01:23, 15 November 2011
Retrieve information about the socket (Socket class)
This method retrieves the information that you request about the socket.
The Info function has an effect similar to
its equivalent $function, $Sock_Info.
Syntax
%string = socket:Info( string)
Syntax terms
%info | A string variable to contain the returned information. | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
socket | A variable or an expression that is a reference to a Socket object. | ||||||||||||||||||
infotype | One of the following strings:
|
Usage notes
- If Info is invoked with a Socket object that is RESET, the results
depend on several factors:
- If the infotype argument is
ONRESET
, the operation is performed normally, with no indication of the fact that the socket is RESET. - Otherwise, if infotype is a keyword that does not require an
OPEN socket, and
ONRESET CONTINUE
,CANCELC
, orLABELC
is in effect for the socket, the stringRESET
is returned, and the last error information is set. - Otherwise, if
ONRESET CONTINUE
is in effect for the socket, the stringRESET
is returned, and the last error information is set. - Otherwise, the request is canceled, or the ONRESET label is jumped to, as explained in " Handling connection errors and RESET sockets".
- If the infotype argument is