:html
<<
128.172
Socket-Object|Socket
$NoSort
--
The IP-Object <!RW>Socket enables the access to the TCP/IP-Sockets in client mode.

The sockets are addressed with the names defined in the basic setup.

The interface parameters are also defined in the basic setup.
>>

<<
128.172.1
Functions of the Socket-Object|Functions
--
>>
<<
128.172.1.1
Socket.IsActive|IsActive
--
<!DEF>
function <!TW>Socket.IsActive : real;
<!TXT>
Returns <!RW>TRUE if the sockets are activated.


<!DEF>
function <!TW>Socket.IsActive (sName : string) : real;
<!TXT>
Returns <!RW>TRUE if the socket <!PW>sName is activated.
>>
<<
128.172.1.2
Socket.IsOpen|IsOpen
--
<!DEF>
function <!TW>Socket.IsOpen (sName : string) : real;
<!TXT>
Returns <!RW>TRUE if the socket <!PW>sName is open.
>>
<<
128.172.1.3
Socket.Error|Error
!128.172.3
--
<!DEF>
function <!TW>Socket.Error (sName : string) : real;
<!TXT>
Returns the current error code of the socket <!PW>sName.
>>
<<
128.172.1.4
Socket.ByteAvailable|ByteAvailable
--
<!DEF>
function <!TW>Socket.ByteAvailable (sName : string) : real;
<!TXT>
Returns the number of characters which are in the receive buffer of the socket <!PW>sName 
>>
<<
128.172.1.5
Socket.Read|Read
--
<!DEF>
function <!TW>Socket.Read (sName : string [; rTimeout : real]) : string;
<!TXT>
Reads in a string from the socket <!PW>sName. 

If <!PW>rTimeout is not specified, the basic setup value is used.

For the string end recognition the Input-EOS-Sequence is used.
>>
<<
128.172.1.6
Socket.Get|Get
--
<!DEF>
function <!TW>Socket.Get (sName : string; rMin, rMax [, rTimeout] : string) : string;
<!TXT>
Reads in a string from the socket <!PW>sName. 

If <!PW>rTimeout is not specified, the basic setup value is used.

The routines waits until either the timeout is over or <!PW>rMax characters are received.

If the timeout is over and at least <!PW>rMin characters were received, then this is NOT assessed as timeout.

EOS-Sequences are not taken into consideration.
>>
<<
128.172.2
Procedures of the Socket-Object|Procedures
--
>>
<<
128.172.2.1
Socket.Open|Open
--
<!DEF>
procedure <!TW>Socket.Open (sName : string);
<!TXT>
Opens the socket <!PW>sName.
>>
<<
128.172.2.2
Socket.Close|Close
--
<!DEF>
procedure <!TW>Socket.Close (sName : string);
<!TXT>
Closes the socket <!PW>sName.
>>
<<
128.172.2.7
Socket.Send|Send
--
<!DEF>
procedure <!TW>Socket.Send (sName : string, .Data : string|vector);
<!TXT>
Sends the string <!PW>Data (the Bytevector <!PW>Data) decorated with the Output-SOS and -EOS sequences to the socket <!PW>sName.
>>
<<
128.172.2.8
Socket.Put|Put
--
<!DEF>
procedure <!TW>Socket.Put (sName : string, .Data : string|vector);
<!TXT>
Sends the string <!PW>Data (the Bytevector <!PW>Data) to the socket <!PW>sName (without taking into consideration the Output-SOS and -EOS Sequences)
>>

<<
128.172.2.9
Socket.ClearInBuffer|ClearInBuffer
--
<!DEF>
procedure <!TW>Socket.ClearInBuffer (sName : string);
<!TXT>
Deletes the receive buffer of the socket <!PW>sName.
>>

<<
128.172.2.10
Socket.Reset|Reset
--
<!DEF>
procedure <!TW>Socket.Reset (sName : string);
<!TXT>
Resets the socket <!PW>sName.
>>

<<
128.172.3
Error codes of the Socket-Object|Error codes
--
<!STBL>
<!+>Code<!+>Meaning</b><!>
<!c>0<!>everything okay <!>
<!c>1<!>Socket not open (or inactive)<!>
<!c>2<!>Exception (unexpected error)<!>
<!c>3<!>Timeout while waiting for data<!>
<!c>4<!>Socket could not be opened<!>
<!c>>10000<!>Windows error code for sockets.<br>
        the meaning is still cryptic.<!>
<!ETBL>

>>

