diff options
| author | 2022-12-18 17:51:35 +0000 | |
|---|---|---|
| committer | 2022-12-18 18:47:28 +0000 | |
| commit | 2ddb62319803f6a3f3246a52b4e009d9ae1daaed (patch) | |
| tree | 96a5d23c8a38f3282f3e52346cb706d55e58658f /include/socket.h | |
| parent | We actually want ADDRESS_FAMILY not SOCKET_ADDRESS for sa_family_t. (diff) | |
Use in_port_t instead of int/unsigned int/long.
Diffstat (limited to 'include/socket.h')
| -rw-r--r-- | include/socket.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/socket.h b/include/socket.h index 47b503a0c..f306a7706 100644 --- a/include/socket.h +++ b/include/socket.h @@ -35,6 +35,7 @@ # include <sys/un.h> #else # include <afunix.h> +typedef USHORT in_port_t; typedef ADDRESS_FAMILY sa_family_t; #endif @@ -83,7 +84,7 @@ namespace irc * @param port A TCP port. * @return True if the IP/port was stored in this socket address; otherwise, false. */ - bool from_ip_port(const std::string& addr, int port); + bool from_ip_port(const std::string& addr, in_port_t port); /** Store a UNIX socket path in this socket address. * @param path A path to a UNIX socket. @@ -95,7 +96,7 @@ namespace irc bool is_local() const; /** Returns the TCP port number of the socket address or 0 if not relevant to this family. */ - int port() const; + in_port_t port() const; /** Returns the size of the structure for use in networking syscalls. */ socklen_t sa_size() const; |
