diff options
author | mrfoxygmfr <mrfoxygmfr@sch9.ru> | 2025-05-21 02:35:18 +0300 |
---|---|---|
committer | mrfoxygmfr <mrfoxygmfr@sch9.ru> | 2025-05-21 02:35:18 +0300 |
commit | b7fa22dfeb60e66a6ba5e0a6a554d0f056e09724 (patch) | |
tree | fa730dbcc885feed46a4ac21449abe8115031bd1 | |
parent | af138ab46ef4dd303d873c05542bb434859225a7 (diff) |
refactor(lib/net): server function should start with server_
-rw-r--r-- | lib/net/server.c | 4 | ||||
-rw-r--r-- | lib/net/server.h | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/net/server.c b/lib/net/server.c index 48213fb..3668462 100644 --- a/lib/net/server.c +++ b/lib/net/server.c @@ -49,8 +49,8 @@ void server_shutdown(server_t* srv) { } } -conn_t* conn_try_accept(server_t* srv) { - int client_socket_fd = accept4(srv->listen_socket_fd, NULL, NULL, SOCK_NONBLOCK); +conn_t* server_try_accept(server_t* srv) { + int client_socket_fd = accept(srv->listen_socket_fd, NULL, NULL); if (client_socket_fd == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK) { return NULL; diff --git a/lib/net/server.h b/lib/net/server.h index b363724..cf048c3 100644 --- a/lib/net/server.h +++ b/lib/net/server.h @@ -10,7 +10,6 @@ typedef struct { server_t* server_init_tcp(const char* addr, const char* port); void server_shutdown(server_t* srv); -conn_t* conn_try_accept(server_t* srv); -void conn_close(conn_t* conn); +conn_t* server_try_accept(server_t* srv); #endif // NET__SERVER_H |