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

Function GetFreeSessionIndex

source/src/enet_encap/encap.c:753–762  ·  view source on GitHub ↗

@brief search for available sessions an return index. * @return return index of free session in anRegisteredSessions. * kInvalidSession .. no free session available */

Source from the content-addressed store, hash-verified

751 * kInvalidSession .. no free session available
752 */
753int GetFreeSessionIndex(void) {
754 for (size_t session_index = 0;
755 session_index < OPENER_NUMBER_OF_SUPPORTED_SESSIONS;
756 session_index++) {
757 if (kEipInvalidSocket == g_registered_sessions[session_index]) {
758 return session_index;
759 }
760 }
761 return kSessionStatusInvalid;
762}
763
764/** @brief copy data from pa_buf in little endian to host in structure.
765 * @param receive_buffer Received message

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected