MCPcopy Create free account
hub / github.com/EIPStackGroup/OpENer / HandleIoConnectionTimeOut

Function HandleIoConnectionTimeOut

source/src/cip/cipioconnection.c:729–779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727}
728
729void HandleIoConnectionTimeOut(CipConnectionObject *connection_object) {
730 CheckIoConnectionEvent(connection_object->produced_path.instance_id,
731 connection_object->consumed_path.instance_id,
732 kIoConnectionEventTimedOut);
733
734 ConnectionObjectSetState(connection_object, kConnectionObjectStateTimedOut);
735 if(connection_object->last_package_watchdog_timer ==
736 connection_object->inactivity_watchdog_timer) {
737 CheckForTimedOutConnectionsAndCloseTCPConnections(connection_object,
738 CloseEncapsulationSessionBySockAddr);
739 }
740
741 if ( kConnectionObjectConnectionTypeMulticast
742 == ConnectionObjectGetTToOConnectionType(connection_object) ) {
743 switch (ConnectionObjectGetInstanceType(connection_object) ) {
744 case kConnectionObjectInstanceTypeIOExclusiveOwner:
745 CloseAllConnectionsForInputWithSameType(
746 connection_object->produced_path.instance_id,
747 kConnectionObjectInstanceTypeIOInputOnly);
748 CloseAllConnectionsForInputWithSameType(
749 connection_object->produced_path.instance_id,
750 kConnectionObjectInstanceTypeIOListenOnly);
751 break;
752 case kConnectionObjectInstanceTypeIOInputOnly:
753 if (kEipInvalidSocket
754 != connection_object->socket[kUdpCommuncationDirectionProducing]) { /* we are the controlling input only connection find a new controller*/
755 CipConnectionObject *next_non_control_master_connection =
756 GetNextNonControlMasterConnection(
757 connection_object->produced_path.instance_id);
758 if (NULL != next_non_control_master_connection) {
759 next_non_control_master_connection->socket[
760 kUdpCommuncationDirectionProducing] =
761 connection_object->socket[kUdpCommuncationDirectionProducing];
762 connection_object->socket[kUdpCommuncationDirectionProducing] =
763 kEipInvalidSocket;
764 next_non_control_master_connection->transmission_trigger_timer =
765 connection_object->transmission_trigger_timer;
766 } else { /* this was the last master connection close all listen only connections listening on the port */
767 CloseAllConnectionsForInputWithSameType(
768 connection_object->produced_path.instance_id,
769 kConnectionObjectInstanceTypeIOListenOnly);
770 }
771 }
772 break;
773 default:
774 break;
775 }
776 }
777
778 ConnectionObjectSetState(connection_object, kConnectionObjectStateTimedOut);
779}
780
781EipStatus SendConnectedData(CipConnectionObject *connection_object) {
782

Callers

nothing calls this directly

Tested by

no test coverage detected