Closes a connection.
Syntax
SRP_TcpClient(Object, "CLOSE")
Returns
Always returns 1.
Remarks
The CLOSE service must be called to close a connection, otherwise the connection remains open until OpenInsight closes. The Object parameter is a handle to an existing connection. Note that the CLOSE operation simply breaks the socket connection, which means the remote socket will not have an opportunity to do any clean up. Many servers expect a command to be sent prior to closing the connection.
If you are communicating with the SRP Engine Service, use CLOSE_SES instead, as it sends a command to the server prior to closing to ensure a clean disconnect.
Example
// Connect to a local socket and then close TcpClientHandle = 0 If SRP_TcpClient(TcpClientHandle, "CONNECT", "127.0.0.1", "7777") then SRP_TcpClient(TcpClientHandle, "CLOSE") end