Read a line from the DataInputStream socket.

1 socket.in.readLine

<socket.in.readLine>
    <socket /> +
</socket.in.readLine>
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>