cleanup, docs

This commit is contained in:
root
2026-06-16 23:02:45 +00:00
parent ea08d5f28b
commit b8b56cf3dd
160 changed files with 1076 additions and 511 deletions
+5 -1
View File
@@ -16,4 +16,8 @@ Reads data from a socket connection.
`max_length` limits how much data is read, and `timeout` controls how long the operation is allowed to wait.
:example
print("socket_read is resource-bound; configure the service or connection, then call it in request code.\n");
u64 fd = socket_connect("127.0.0.1", 80);
socket_write(fd, "GET / HTTP/1.0\r\nHost: localhost\r\nConnection: close\r\n\r\n");
String chunk = socket_read(fd, 1024, 2);
socket_close(fd);
print(str_starts_with(chunk, "HTTP/") ? "read an HTTP response from the server" : "no data", "\n");