From 671e29975a51eca927b4bdd3957476dcd66ee700 Mon Sep 17 00:00:00 2001 From: Dongha Kim Date: Mon, 16 Dec 2024 13:54:32 -0700 Subject: [PATCH] Fix minor errors --- core/federated/RTI/rti_remote.c | 4 ++-- include/core/federated/network/net_common.h | 15 --------------- include/core/federated/network/socket_common.h | 4 ++-- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/core/federated/RTI/rti_remote.c b/core/federated/RTI/rti_remote.c index 81da116b4..71deb6644 100644 --- a/core/federated/RTI/rti_remote.c +++ b/core/federated/RTI/rti_remote.c @@ -1412,8 +1412,8 @@ static bool authenticate_federate(int* socket) { void lf_connect_to_federates(int socket_descriptor) { for (int i = 0; i < rti_remote->base.number_of_scheduling_nodes; i++) { - struct sockaddr* client_fd; - int socket_id = accept_socket(rti_remote->socket_descriptor_TCP, client_fd); + struct sockaddr client_fd; + int socket_id = accept_socket(rti_remote->socket_descriptor_TCP, &client_fd); // Wait for the first message from the federate when RTI -a option is on. #ifdef __RTI_AUTH__ if (rti_remote->authentication_enabled) { diff --git a/include/core/federated/network/net_common.h b/include/core/federated/network/net_common.h index 48976f1c5..47826be3e 100644 --- a/include/core/federated/network/net_common.h +++ b/include/core/federated/network/net_common.h @@ -186,13 +186,6 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FED_COM_BUFFER_SIZE 256u -/** - * Maximum number of port addresses that a federate will try to connect to the RTI on. - * If you are using automatic ports begining at DEFAULT_PORT, this puts an upper bound - * on the number of RTIs that can be running on the same host. - */ -#define MAX_NUM_PORT_ADDRESSES 16 - /** * Time that a federate waits before asking * the RTI again for the port and IP address of a federate @@ -201,14 +194,6 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define ADDRESS_QUERY_RETRY_INTERVAL MSEC(250) -/** - * Default port number for the RTI. - * Unless a specific port has been specified by the LF program in the "at" - * for the RTI or on the command line, when the RTI starts up, it will attempt - * to open a socket server on this port. - */ -#define DEFAULT_PORT 15045u - /** * Delay the start of all federates by this amount. * This helps ensure that the federates do not start at the same time. diff --git a/include/core/federated/network/socket_common.h b/include/core/federated/network/socket_common.h index 3921379ef..8c2678451 100644 --- a/include/core/federated/network/socket_common.h +++ b/include/core/federated/network/socket_common.h @@ -34,7 +34,7 @@ * If you are using automatic ports begining at DEFAULT_PORT, this puts an upper bound * on the number of RTIs that can be running on the same host. */ -#define MAX_NUM_PORT_ADDRESSES 16 +#define MAX_NUM_PORT_ADDRESSES 16u /** * Time to wait before re-attempting to bind to a port. @@ -90,7 +90,7 @@ int create_real_time_tcp_socket_errexit(); * @param final_socket The socket descriptor on which to accept connections. * @param final_port The final port of the TCP or UDP socket. */ -int create_rti_server(uint16_t port, socket_type_t socket_type, int* final_socket, uint16_t* final_port); +void create_rti_server(uint16_t port, socket_type_t socket_type, int* final_socket, uint16_t* final_port); int accept_socket(int socket, struct sockaddr* client_fd); /**