Skip to content

Commit

Permalink
Remove sockaddr from accpet_socket as input
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakio815 committed Dec 17, 2024
1 parent 6e5dc7b commit 8ead884
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/federated/network/socket_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,14 @@ void create_UDP_server(uint16_t port, int* final_socket, uint16_t* final_port) {
*final_port = used_port;
}

int accept_socket(int socket, struct sockaddr* client_fd) {
int accept_socket(int socket) {
struct sockaddr client_fd;
// Wait for an incoming connection request.
uint32_t client_length = sizeof(*client_fd);
uint32_t client_length = sizeof(client_fd);
// The following blocks until a federate connects.
int socket_id = -1;
while (1) {
socket_id = accept(socket, client_fd, &client_length);
socket_id = accept(socket, &client_fd, &client_length);
if (socket_id >= 0) {
// Got a socket
break;
Expand Down

0 comments on commit 8ead884

Please sign in to comment.