GetSocketNumber (Socket function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Template:Socket:GetSocketNumber subtitle}}
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
[[Category:Socket methods|GetSocketNumber function]]
<p>
<var>GetSocketNumber</var> is a member of the <var>[[Socket class|Socket]]</var> class.
</p>


This method returns a socket number for the method <var>Socket</var> object.
This method returns a socket number for the method <var>Socket</var> object.
The returned number can then be used with $Sock_xxx calls,
The returned number can then be used with [[Janus Sockets $functions|$Sock_xxx]] calls,
so $Sock_xxx code can be used in conjunction with a <var>Socket</var> object.
so $Sock_xxx code can be used in conjunction with a <var>Socket</var> object.
==Syntax==
==Syntax==
<p class="syntax">%snum = %socko:GetSocketNumber
{{Template:Socket:GetSocketNumber syntax}}
</p>
 
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%snum</th>
<tr><th>%number</th>
<td>A numeric variable to contain the value of the number of the <var class="term">%socko</var> socket.
<td>A numeric variable to contain the value of the number of the <var class="term">socket</var> socket.
</td></tr>
</td></tr>
<tr><th>%socko</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></table>
</td></tr></table>
==Usage notes==
==Usage notes==
<ul>
<ul>
Line 33: Line 30:
For information about <var>NOCLOSE</var>, see  <var>[[Set (Socket function)|Set]]</var>.
For information about <var>NOCLOSE</var>, see  <var>[[Set (Socket function)|Set]]</var>.
</ul>
</ul>
{{Template:Socket:GetSocketNumber footer}}

Latest revision as of 15:41, 11 June 2012

Socket number of this socket (Socket class)


This method returns a socket number for the method Socket object. The returned number can then be used with $Sock_xxx calls, so $Sock_xxx code can be used in conjunction with a Socket object.

Syntax

%number = socket:GetSocketNumber

Syntax terms

%number A numeric variable to contain the value of the number of the socket socket.
socket A variable or an expression that is a reference to a Socket object.

Usage notes

  • After GetSocketNumber returns, the Socket object is no longer valid: it is null, and the socket is only accessible by the returned number. To access the socket as an object again, you use GetSocketObject.
  • If the object returned by a GetSocketObject invocation is the method object for a subsequent GetSocketNumber invocation, the NOCLOSE setting of the original numbered socket is applied to the numbered socket returned by GetSocketNumber. For information about NOCLOSE, see Set.