Merge pull request #4261 from laytan/net-bound-endpoint

net: add `bound_endpoint` procedure
This commit is contained in:
gingerBill
2024-09-19 12:53:42 +01:00
committed by GitHub
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)
}