aboutsummaryrefslogtreecommitdiff
path: root/core/net/socket.odin
diff options
context:
space:
mode:
authorPePerRoNii <wachiraphol.yin@gmail.com>2025-06-11 12:44:17 +0700
committerPePerRoNii <wachiraphol.yin@gmail.com>2025-06-11 12:44:17 +0700
commitc402ac86060e66a5b127352d9f515c568242562d (patch)
treecb1b4411cf1ae9c7ac0f29723ccf2fb92a2b8d71 /core/net/socket.odin
parent5bf180d8f9ab3f673f74119c9dbbe239e94ced63 (diff)
Add entry point in core:net as peer_endpoint
Diffstat (limited to 'core/net/socket.odin')
-rw-r--r--core/net/socket.odin7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/net/socket.odin b/core/net/socket.odin
index 801693962..ada7247e3 100644
--- a/core/net/socket.odin
+++ b/core/net/socket.odin
@@ -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)
}