File tree Expand file tree Collapse file tree 2 files changed +3
-29
lines changed Expand file tree Collapse file tree 2 files changed +3
-29
lines changed Original file line number Diff line number Diff line change @@ -333,8 +333,8 @@ int main(int argc, const char* argv[]) {
333333 rti .base .scheduling_nodes [i ] = (scheduling_node_t * ) fed_info ;
334334 }
335335 // TODO: Need to add user_specified_port
336- if (start_net_rti_server ()){
337- net_wait_for_federates (rti .rti_netdrv );
336+ if (start_rti_server ()){
337+ wait_for_federates (rti .rti_netdrv );
338338 normal_termination = true;
339339 if (rti .base .tracing_enabled ) {
340340 // No need for a mutex lock because all threads have exited.
@@ -343,19 +343,6 @@ int main(int argc, const char* argv[]) {
343343 }
344344 }
345345
346-
347-
348- // int socket_descriptor = start_rti_server(rti.user_specified_port);
349- // if (socket_descriptor >= 0) {
350- // wait_for_federates(socket_descriptor);
351- // normal_termination = true;
352- // if (rti.base.tracing_enabled) {
353- // // No need for a mutex lock because all threads have exited.
354- // stop_trace_locked(rti.base.trace);
355- // lf_print("RTI trace file saved.");
356- // }
357- // }
358-
359346 lf_print ("RTI is exiting." ); // Do this before freeing scheduling nodes.
360347 free_scheduling_nodes (rti .base .scheduling_nodes , rti .base .number_of_scheduling_nodes );
361348
Original file line number Diff line number Diff line change @@ -2100,7 +2100,7 @@ void initialize_federate(federate_info_t *fed, uint16_t id) {
21002100 fed -> clock_netdrv = netdrv_init ();
21012101}
21022102
2103- int32_t start_net_rti_server () {
2103+ int32_t start_rti_server () {
21042104 _lf_initialize_clock ();
21052105 // Create the RTI's netdriver.
21062106 int success = create_net_server (rti_remote -> rti_netdrv , RTI );
@@ -2112,19 +2112,6 @@ int32_t start_net_rti_server() {
21122112 return success ;
21132113}
21142114
2115- int32_t start_rti_server (uint16_t port ) {
2116- _lf_initialize_clock ();
2117- // Create the TCP socket server
2118- rti_remote -> socket_descriptor_TCP = create_rti_server (port , TCP );
2119- lf_print ("RTI: Listening for federates." );
2120- // Create the UDP socket server
2121- // Try to get the rti_remote->final_port_TCP + 1 port
2122- if (rti_remote -> clock_sync_global_status >= clock_sync_on ) {
2123- rti_remote -> socket_descriptor_UDP = create_rti_server (rti_remote -> final_port_TCP + 1 , UDP );
2124- }
2125- return rti_remote -> socket_descriptor_TCP ;
2126- }
2127-
21282115void net_wait_for_federates (netdrv_t * netdrv ) {
21292116 // Wait for connections from federates and create a thread for each.
21302117 net_lf_connect_to_federates (netdrv );
You can’t perform that action at this time.
0 commit comments