net: add bound_endpoint procedure

This commit is contained in:
Laytan Laats
2024-09-17 22:22:19 +02:00
parent 6ef779cd5c
commit 652557bfcd
8 changed files with 111 additions and 24 deletions
+7
View File
@@ -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)
}