Opens a TCP connection with the host indicated in the indicated port. With this tag an object type socket is created and then it is used to communicate as with the host. Any error with the creation of the communication channel or if the timeout is exceeded, it causes an exception.
|Ahost||string||Name or IP server which will receive the request. The server has a service being executed in a port, through which the connection will be established via socket.|
|Aport||number||Port in which the service is running.|
|Atimeout||string||Time expressed in millliseconds, after which if no response has been received, the request is canceled.|
|socket||Socket type object.|
The following example shows how a connection to the host w2ksrv1 is open.
<xsql-script name='socket'> <body> <!-- open LPR client --> <set name='s'> <socket host='w2ksrv1' port='515' timeout='5000' /> </set> <!-- get queue state --> <socket.out.write> <s /> <byte>4</byte> </socket.out.write> </body> </xsql-script>