Event Error

In the new server version there is a possibility to receive errors from the CustomTCP driver.


The syntax looks as follows:

//Create an event when receiving an error for the CustomTCP driver
IR.AddListener(IR.EVENT_ERROR, IR.GetDevice("AV & Custom Systems (TCP)"), function(ID, LocalIP, LocalPort, HostIP, HostPort, ErrorCode)
{
    IR.Log("EVENT_ERROR: " + ID + " " + LocalIP + " " + LocalPort + " " + HostIP + " " + HostPort + " " + ErrorCode);   
})

Parameters:

ID - the driver identifier

LocalIP - the IP-address from where the connection goes

LocalPort - the port from where the connection goes

HostIP - the IP-address where the connection goes

HostPort - the port where the connection goes

ErrorCode - it can be as follows :

    • CE_WAIT_CONNECTION = 1 - Error of expecting the connection
    • CE_WAIT_DATA = 2 - Error of expecting data
    • CE_NO_CONNECTION_LICENCE = 3 - No license for the connection (not implemented at the moment)
    • CE_NO_WORK_LICENCE= 4 - No license for work (not implemented at the moment)
    • CE_WORK_ERROR = 5 - Error occurred during connection processing (not implemented at the moment)

Example project - TestTimeOutLog.sirpz

This article was helpful for 1 person. Is this article helpful for you?