Original Author Paul Laughton, 2011
Page 122
De Re BASIC!
has been made or an error is detected. If the Server does not respond, the command should time out
after a couple of minutes, but this is not certain.
If the parameter is false (zero), the command completes immediately. Use Socket.server.status to
determine when the connection is made. If you monitor the socket status, you can set your own time-
out policy. You must use the Socket.client.close command to stop a connection attempt that has not
completed.
Socket.client.status <status_nvar>
Get the current client socket connection status and place the value in the numeric variable
<status_nvar>.
0 = Nothing going on
2 = Connecting
3 = Connected
Socket.client.server.ip <svar>
Return the IP of the server that this client is connected to in the string variable.
Socket.client.read.line <line_svar>
Read a line from the previously-connected Server and place the line into the line string variable. The
command does not return until the Server sends a line. To avoid an infinite delay waiting for the Server
to send a line, the Socket.client.read.ready command can be repeatedly executed with timeouts.
Socket.client.read.ready <nvar>
If the previously created Client socket has not received a line for reading by Socket.client.read.line then
set the return variable <nvar> to zero. Otherwise return a non-zero value.
The Socket.client.read.line command does not return until a line has been received from the Server.
This command can be used to allow your program to time out if a line has not been received within a
pre-determined time span. You can be sure that Socket.client.read.line will return with a line of data if
Socket.client.read.ready returns a non-zero value.
Socket.client.read.file <file_nexp>
Read file data transmitted by the Server and write it to a file. The <file_nexp> is the file index of a file
opened for write by Byte.open write command. For example:
Byte.open w, fw, "image.jpg"
Socket.client.read.file fw
Byte.close fw
Socket.client.write.line <line_sexp>
Send the string expression <line_sexp> to the previously-connected Server as UTF-16 characters. End of
line characters will be added to the end of the line.