diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-09-17 22:22:19 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-09-17 22:22:19 +0200 |
| commit | 652557bfcd64deccf018e96817a001fd9c4d69a1 (patch) | |
| tree | 0f2ba9b19523fd200dcdaaa709b4383f4118a7e6 /core/net/socket.odin | |
| parent | 6ef779cd5c8260b2e6979e676d28489fd53dd599 (diff) | |
net: add `bound_endpoint` procedure
Diffstat (limited to 'core/net/socket.odin')
| -rw-r--r-- | core/net/socket.odin | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/net/socket.odin b/core/net/socket.odin index e36c67d21..0468ead00 100644 --- a/core/net/socket.odin +++ b/core/net/socket.odin @@ -134,6 +134,13 @@ listen_tcp :: proc(interface_endpoint: Endpoint, backlog := 1000) -> (socket: TC return _listen_tcp(interface_endpoint, backlog) } +/* + Returns the endpoint that the given socket is listening / bound on. +*/ +bound_endpoint :: proc(socket: Any_Socket) -> (endpoint: Endpoint, err: Network_Error) { + return _bound_endpoint(socket) +} + accept_tcp :: proc(socket: TCP_Socket, options := default_tcp_options) -> (client: TCP_Socket, source: Endpoint, err: Network_Error) { return _accept_tcp(socket, options) } |