diff options
author | default <nobody@localhost> | 2023-09-23 22:02:52 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-09-23 22:02:52 +0200 |
commit | 5f5e4b587e6d21ca43a2bbdb0969ffce441cee35 (patch) | |
tree | 0b0c1eef8241050370b147e9b45dc615c571f9e1 /xs_socket.h | |
parent | 291331c74557786cf5ef5b62a647048131f1394c (diff) |
Backport from xs.
Diffstat (limited to 'xs_socket.h')
-rw-r--r-- | xs_socket.h | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/xs_socket.h b/xs_socket.h index a2f9cb6..eea2f2d 100644 --- a/xs_socket.h +++ b/xs_socket.h @@ -5,8 +5,7 @@ #define _XS_SOCKET_H int xs_socket_timeout(int s, double rto, double sto); -int xs_socket_server_serv(const char *addr, const char *serv); -int xs_socket_server(const char *addr, int port); +int xs_socket_server(const char *addr, const char *serv); FILE *xs_socket_accept(int rs); xs_str *xs_socket_peername(int s); int xs_socket_connect(const char *addr, const char *serv); @@ -44,7 +43,7 @@ int xs_socket_timeout(int s, double rto, double sto) } -int xs_socket_server_serv(const char *addr, const char *serv) +int xs_socket_server(const char *addr, const char *serv) /* opens a server socket by service name (or port as string) */ { int rs = -1; @@ -88,16 +87,6 @@ end: } -int xs_socket_server(const char *addr, int port) -/* opens a server socket (port as integer) */ -{ - char serv[32]; - - snprintf(serv, sizeof(serv), "%d", port); - return xs_socket_server_serv(addr, serv); -} - - FILE *xs_socket_accept(int rs) /* accepts an incoming connection */ { |