MCO_RET mco_lews_check_connections(timer_unit accept_timeout)
accept_timeout
This function checks for new incoming client connections on the LEWS server socket and processes them if available. It blocks for up to
accept_timeoutmilliseconds while waiting for a connection.It is typically called repeatedly in a server loop after mco_lews_start_listen() has been invoked.
MCO_RET mco_lews_start() { MCO_RET rc; rc = mco_lews_start_listen(); if (MCO_S_OK != rc) return rc; while (!stop_flag) { rc = mco_lews_check_connections(LEWS_ACCEPT_TIMEOUT); /* Non-fatal or expected return codes are ignored */ if ((rc != MCO_E_LEWS_TIMEOUT) && (rc != MCO_S_OK) && (rc != MCO_E_NW_ACCEPT)) return rc; } return MCO_S_OK; }
MCO_S_OK
MCO_E_LEWS_TIMEOUT
MCO_E_NW_ACCEPT