Closes a connection.


SRP_TcpClient(Object, "CLOSE")


Always returns 1.


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.


// Connect to a local socket and then close 
TcpClientHandle = 0 
If SRP_TcpClient(TcpClientHandle, "CONNECT", "", "7777") then 
   SRP_TcpClient(TcpClientHandle, "CLOSE")
  • No labels