EEIP.NET
EEIP.NET copied to clipboard
TCP connection to SMC EX260-SEN closes after ~2-minutes
I am running into an issue where after approximately 2-3 minutes, the connection to the hardware disconnects and I am unable to call SetAttributeSingle()
.
The current work-around has been to send some type of request to the hardware to keep alive.
See pseudocode:
while(true)
{
var data = SolenoidData()
// only set attributes if new data is present. data is the bit that needs to toggle on/off the solenoid
if (newData)
{
_ethernetIPClient.SetAttributeSingle(classID, instanceID, attributeID, data);
}
else
{
_ = _ethernetIPClient.IdentityObject.SerialNumber; // do this so that connection is not lost after N minutes.
}
}
Any idea as to why the TCP client is disconnecting? Or is this a hardware issue where the device releases the TCP handle from the client?