Skip to content

Commit

Permalink
Fix minor errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakio815 committed Dec 16, 2024
1 parent c6f313f commit 671e299
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
4 changes: 2 additions & 2 deletions core/federated/RTI/rti_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
15 changes: 0 additions & 15 deletions include/core/federated/network/net_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions include/core/federated/network/socket_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
/**
Expand Down

0 comments on commit 671e299

Please # to comment.