cleanup, docs
This commit is contained in:
@@ -15,4 +15,7 @@ Writes `data` to the given socket.
|
||||
The function returns `true` when the write succeeds.
|
||||
|
||||
:example
|
||||
print("socket_write is resource-bound; configure the service or connection, then call it in request code.\n");
|
||||
u64 fd = socket_connect("127.0.0.1", 80);
|
||||
bool sent = socket_write(fd, "GET / HTTP/1.0\r\nHost: localhost\r\nConnection: close\r\n\r\n");
|
||||
socket_close(fd);
|
||||
print(sent ? "request sent" : "send failed", "\n");
|
||||
|
||||
Reference in New Issue
Block a user