@@ -273,9 +273,7 @@ static void* pending_grant_thread(void* federate) {
273273 * @param fed The federate.
274274 * @param tag The tag to grant.
275275 */
276- static void notify_tag_advance_grant_delayed (scheduling_node_t * e , tag_t tag ) {
277- federate_info_t * fed = (federate_info_t * )GET_FED_INFO (e -> id );
278-
276+ static void notify_tag_advance_grant_delayed (federate_info_t * fed , tag_t tag ) {
279277 // Check wether there is already a pending grant
280278 // And check the pending provisional grant as well
281279 lf_mutex_lock (& rti_mutex );
@@ -418,9 +416,7 @@ static void* pending_provisional_grant_thread(void* federate) {
418416 * @param fed The federate.
419417 * @param tag The provisional tag to grant.
420418 */
421- static void notify_provisional_tag_advance_grant_delayed (scheduling_node_t * e , tag_t tag ) {
422- federate_info_t * fed = (federate_info_t * )e ;
423-
419+ static void notify_provisional_tag_advance_grant_delayed (federate_info_t * fed , tag_t tag ) {
424420 // Proceed with the delayed provisional tag grant notification only if
425421 // there is no pending grant and no provisional pending grant
426422 LF_MUTEX_LOCK (& rti_mutex );
@@ -981,9 +977,10 @@ void send_start_tag(federate_info_t* my_fed, instant_t federation_start_time, ta
981977 // message.
982978 // In the startup phase, federates will receive identical start_time and
983979 // effective_start_tag
984- unsigned char start_time_buffer [MSG_TYPE_TIMESTAMP_LENGTH ];
985- start_time_buffer [0 ] = MSG_TYPE_TIMESTAMP ;
980+ unsigned char start_time_buffer [MSG_TYPE_TIMESTAMP_START_LENGTH ];
981+ start_time_buffer [0 ] = MSG_TYPE_TIMESTAMP_START ;
986982 encode_int64 (swap_bytes_if_big_endian_int64 (start_time ), & start_time_buffer [1 ]);
983+ encode_tag (& (start_time_buffer [1 + sizeof (instant_t )]), federate_start_tag );
987984
988985 if (rti_remote -> base .tracing_enabled ) {
989986 tracepoint_rti_to_federate (send_TIMESTAMP , my_fed -> enclave .id , & federate_start_tag );
@@ -1509,7 +1506,7 @@ static int32_t receive_and_check_fed_id_message(int* socket_id, struct sockaddr_
15091506 // First byte received is the message type.
15101507 if (buffer [0 ] != MSG_TYPE_FED_IDS ) {
15111508 if (rti_remote -> base .tracing_enabled ) {
1512- tracepoint_rti_to_federate (rti_remote -> base . trace , send_REJECT , fed_id , NULL );
1509+ tracepoint_rti_to_federate (send_REJECT , fed_id , NULL );
15131510 }
15141511 if (buffer [0 ] == MSG_TYPE_P2P_SENDING_FED_ID || buffer [0 ] == MSG_TYPE_P2P_TAGGED_MESSAGE ) {
15151512 // The federate is trying to connect to a peer, not to the RTI.
@@ -2022,15 +2019,13 @@ void* lf_connect_to_transient_federates_thread(void* nothing) {
20222019 // The following blocks until a federate connects.
20232020 int socket_id = -1 ;
20242021 while (1 ) {
2025- if (!rti_remote -> all_persistent_federates_exited ) {
2026- return NULL ;
2027- }
2022+ // if (!rti_remote->all_persistent_federates_exited) {
2023+ // return NULL;
2024+ // }
20282025 socket_id = accept (rti_remote -> socket_descriptor_TCP , & client_fd , & client_length );
20292026 if (socket_id >= 0 ) {
20302027 // Got a socket
20312028 break ;
2032- } else if (socket_id < 0 && (errno != EAGAIN || errno != EWOULDBLOCK )) {
2033- lf_print_error_system_failure ("RTI failed to accept the socket." );
20342029 } else {
20352030 // Try again
20362031 lf_print_warning ("RTI failed to accept the socket. %s. Trying again." , strerror (errno ));
0 commit comments