Add entry point in core:net as peer_endpoint

This commit is contained in:
PePerRoNii
2025-06-11 12:44:17 +07:00
parent 5bf180d8f9
commit c402ac8606

View File

@@ -178,6 +178,13 @@ bound_endpoint :: proc(socket: Any_Socket) -> (endpoint: Endpoint, err: Listen_E
return _bound_endpoint(socket)
}
/*
Returns the endpoint that the given socket is connected to. (Peer's endpoint)
*/
peer_endpoint :: proc(socket: Any_Socket) -> (endpoint: Endpoint, err: TCP_Recv_Error) {
return _peer_endpoint(socket)
}
accept_tcp :: proc(socket: TCP_Socket, options := DEFAULT_TCP_OPTIONS) -> (client: TCP_Socket, source: Endpoint, err: Accept_Error) {
return _accept_tcp(socket, options)
}