Home AMX User Forum AMX General Discussion

IP coms?

Hello,

I am looking for the correct way to maintain comms with I/P devices.

I am using TCP protocol to control a matrix switcher and projectors.

The problem I seem to have is that when a device is turned off or the connection is disrupted for whatever reason, the netlinx seems to think the connection is live. Though the code I have written is looking for feedback from the device and so attempts to reconnect. This results in a 'Socket already in use' error. But fails to reconnect.

Any suggestions please?

Comments

  • NetLinx uses an IP timeout of about 45 seconds to detect the connection offline. But you have to consider that every string sent in this "lag" time, will extend the timeout.

    So the most solid way on TCP is to send your string to the other device, and manually wait for a response within lets say 10 seconds. Send the next data just if a response was received. If no response is comming in this time, manually assume that the unit is offline, close the IP connection, and try to reopen it. In some cases it could be better to open the TCP connect, wait for the online event, send your data, and close the connection.
  • viningvining Posts: 4,368
    Poll your devices and use that to determine your online status. You can have a var to indicate when the socket connection is made but then use another var to reflect an active connection by way of responses to your polling.
Sign In or Register to comment.