From acb455370f428017098e621e0fe2bfa314961f14 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Thu, 1 Feb 2024 11:18:48 -0700 Subject: [PATCH] Try erasing the net functions for git history --- core/federated/RTI/main.c | 17 ++--------------- core/federated/RTI/rti_remote.c | 15 +-------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/core/federated/RTI/main.c b/core/federated/RTI/main.c index 317daf319..c88f5c20e 100644 --- a/core/federated/RTI/main.c +++ b/core/federated/RTI/main.c @@ -333,8 +333,8 @@ int main(int argc, const char* argv[]) { rti.base.scheduling_nodes[i] = (scheduling_node_t *) fed_info; } // TODO: Need to add user_specified_port - if (start_net_rti_server()){ - net_wait_for_federates(rti.rti_netdrv); + if (start_rti_server()){ + wait_for_federates(rti.rti_netdrv); normal_termination = true; if (rti.base.tracing_enabled) { // No need for a mutex lock because all threads have exited. @@ -343,19 +343,6 @@ int main(int argc, const char* argv[]) { } } - - -// int socket_descriptor = start_rti_server(rti.user_specified_port); -// if (socket_descriptor >= 0) { -// wait_for_federates(socket_descriptor); -// normal_termination = true; -// if (rti.base.tracing_enabled) { -// // No need for a mutex lock because all threads have exited. -// stop_trace_locked(rti.base.trace); -// lf_print("RTI trace file saved."); -// } -// } - lf_print("RTI is exiting."); // Do this before freeing scheduling nodes. free_scheduling_nodes(rti.base.scheduling_nodes, rti.base.number_of_scheduling_nodes); diff --git a/core/federated/RTI/rti_remote.c b/core/federated/RTI/rti_remote.c index a83f28e86..dbb9dbb5c 100644 --- a/core/federated/RTI/rti_remote.c +++ b/core/federated/RTI/rti_remote.c @@ -2100,7 +2100,7 @@ void initialize_federate(federate_info_t *fed, uint16_t id) { fed->clock_netdrv = netdrv_init(); } -int32_t start_net_rti_server() { +int32_t start_rti_server() { _lf_initialize_clock(); // Create the RTI's netdriver. int success = create_net_server(rti_remote->rti_netdrv, RTI); @@ -2112,19 +2112,6 @@ int32_t start_net_rti_server() { return success; } -int32_t start_rti_server(uint16_t port) { - _lf_initialize_clock(); - // Create the TCP socket server - rti_remote->socket_descriptor_TCP = create_rti_server(port, TCP); - lf_print("RTI: Listening for federates."); - // Create the UDP socket server - // Try to get the rti_remote->final_port_TCP + 1 port - if (rti_remote->clock_sync_global_status >= clock_sync_on) { - rti_remote->socket_descriptor_UDP = create_rti_server(rti_remote->final_port_TCP + 1, UDP); - } - return rti_remote->socket_descriptor_TCP; -} - void net_wait_for_federates(netdrv_t *netdrv) { // Wait for connections from federates and create a thread for each. net_lf_connect_to_federates(netdrv);