uce/site/doc/pages/socket_close.txt
2026-06-16 23:02:45 +00:00

19 lines
350 B
Plaintext

:sig
void socket_close(u64 sockfd)
:params
sockfd : socket handle
:see
>socket
:content
Closes an existing socket connection.
Use this when you are done with a socket opened through `socket_connect()`.
:example
u64 fd = socket_connect("127.0.0.1", 80);
print(fd != 0 ? "opened a socket" : "open failed", ", now closing it\n");
socket_close(fd);