added send and recv builtins

This commit is contained in:
cozis
2021-12-04 21:02:50 +01:00
parent 57c0d7c910
commit 014287509a
5 changed files with 106 additions and 3 deletions
+11 -1
View File
@@ -23,4 +23,14 @@ if net.connect(fd, { sin_family: net.AF_INET, sin_port: net.htons(port), sin_add
return none;
}
print('Connected!\n');
print('Connected!\n');
buffer = newBuffer(16);
buffer[0] = 9;
buffer[1] = 7;
buffer[2] = 255;
n = net.send(fd, buffer, 0);
print('Sent ', n, ' bytes: ', buffer, '\n');