Socket methods syntax: Difference between revisions
m (Automatically generated page update) |
m (Automatically generated page update) |
||
Line 9: | Line 9: | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="literal">%(Socket):[[ErrInfo (Socket function)|ErrInfo]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="literal">%(Socket):[[ErrInfo (Socket function)|ErrInfo]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[GetSocketNumber (Socket function)|GetSocketNumber]]</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[GetSocketNumber (Socket function)|GetSocketNumber]]</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%socket</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Socket)</span><span class="squareb">]</span><span class="literal"> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%socket</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Socket):</span><span class="squareb">]</span><span class="literal">[[GetSocketObject (Socket function)|GetSocketObject]]</span><span class="literal">(</span> <span class="term" title="Number">number</span><span class="literal">)</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[Info (Socket function)|Info]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[Info (Socket function)|Info]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%socket</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Socket)</span><span class="squareb">]</span><span class="literal"> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%socket</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Socket):</span><span class="squareb">]</span><span class="literal">[[New (Socket constructor)|New]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">ClientPort=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Host=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> - | ||
<span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="Number">Port=</span><span class="squareb">]</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">SSL=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> - | <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="Number">Port=</span><span class="squareb">]</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">SSL=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> - | ||
<span class="squareb">[</span><span class="literal" title="BOOLEAN">TcpKeepAlive=</span> <span class="term" title="BOOLEAN">bOOLEAN</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p> | <span class="squareb">[</span><span class="literal" title="BOOLEAN">TcpKeepAlive=</span> <span class="term" title="BOOLEAN">bOOLEAN</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p> | ||
Line 30: | Line 30: | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%number</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">socket</span><span class="literal">:[[Send (Socket function)|Send]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Options=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%number</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">socket</span><span class="literal">:[[Send (Socket function)|Send]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Options=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%number</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">socket</span><span class="literal">:[[SendWithLineEnd (Socket function)|SendWithLineEnd]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Options=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%number</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">socket</span><span class="literal">:[[SendWithLineEnd (Socket function)|SendWithLineEnd]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Options=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%socket</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Socket)</span><span class="squareb">]</span><span class="literal"> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%socket</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(Socket):</span><span class="squareb">]</span><span class="literal">[[ServerSocket (Socket function)|ServerSocket]]</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%string</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">socket</span><span class="literal">:[[Set (Socket function)|Set]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="comma">,</span> <span class="squareb">[</span><span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="squareb">[</span><span class="term">%string</span><span class="literal"> =</span><span class="squareb">]</span> <span class="term">socket</span><span class="literal">:[[Set (Socket function)|Set]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="comma">,</span> <span class="squareb">[</span><span class="term" title="String">string</span><span class="squareb">]</span><span class="literal">)</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[TranIn (Socket function)|TranIn]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[TranIn (Socket function)|TranIn]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[TranOut (Socket function)|TranOut]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[TranOut (Socket function)|TranOut]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[URLEncode (Socket function)|URLEncode]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%string</span><span class="literal"> =</span> <span class="term">socket</span><span class="literal">:[[URLEncode (Socket function)|URLEncode]]</span><span class="literal">(</span> <span class="term" title="String">string</span><span class="literal">)</span></p> |
Revision as of 20:37, 30 November 2011
The syntax for each of the Socket class methods is shown below.
Square brackets indicate optional elements of the method invocation. See also the notation conventions for methods and the List of Socket methods.
[%string =] socket:Capture( string)
%string = socket:CertInfo( string, [number])
%number = socket:CertLevels
%string = socket:Certificate[( [RequestCertificate= boolean])]
[%number =] socket:Close
%string = %(Socket):ErrInfo( string)
%number = socket:GetSocketNumber
%socket = [%(Socket):]GetSocketObject( number)
%string = socket:Info( string)
%socket = [%(Socket):]New[( [[ClientPort=] string], [[Host=] string], - [[Port=] number], [[SSL=] string], - [TcpKeepAlive= bOOLEAN])]
%string = %(Socket):Num[( [string])]
[%number =] %(Socket):OnReset[( [label])]
%BytesReceived = socket:Receive( [Target=] string, [[MaxBytes=] number], - [[MinBytes=] number], [[Options=] string])
%BytesReceived = socket:ReceiveAndParse( [Target=] string, - [[MaxBytes=] number], - [[ParseTokenIndex=] number], - [[Options=] string])
%BytesReceived = socket:ReceiveAsynchronous( [Target=] string, - [[MaxBytes=] number], - [[Options=] string], - [Wait= boolean])
%ReceivedFin = socket:ReceivedFin
[%number =] socket:SSLOn
[%number =] socket:Send( string, [[Options=] string])
[%number =] socket:SendWithLineEnd( string, [[Options=] string])
%socket = [%(Socket):]ServerSocket
[%string =] socket:Set( string, [string])
%string = socket:TranIn( string)
%string = socket:TranOut( string)
%string = socket:URLEncode( string)