Read a line from the DataInputStream socket.
1 socket.in.readLine
<socket.in.readLine>
<socket /> +
</socket.in.readLine>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Esocket | Socket | Socket type object. |
Returns | |
---|---|
Type | Description |
string | String of characters ASCII send by the remote server to which the socket is connected. If an error or a timeout occurs, it returns a null value. |
Example
This example simulates LPR client and ask the status of a queue.
Copy
<xsql-script name='socket'> <body> <!-- open LPR client --> <set name='s'> <socket host='w2ksrv1' port='515' /> </set> <!-- get queue state --> <socket.out.write> <s /> <byte>4</byte> </socket.out.write> <socket.out.print> <s /> <string>hplj_3330<string.nl /></string> </socket.out.print> <!-- print response --> <while> <expr> <isnotnull> <set name='line'><socket.in.readLine><s /></socket.in.readLine></set> </isnotnull> </expr> <do> <println><line /></println> </do> </while> </body> </xsql-script>