Sockets: Difference between revisions
m
→{{header|Wren}}: Minor tidy
Drkameleon (talk | contribs) (added Arturo implementation) |
m (→{{header|Wren}}: Minor tidy) |
||
Line 1,398:
{{trans|C}}
An embedded program so we can ask the C host to call the relevant library functions for us.
<syntaxhighlight lang="
var AF_UNSPEC = 0
Line 1,471:
<br>
Now embed this script in the following C program, compile and run it.
<syntaxhighlight lang="c">
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Line 1,671 ⟶ 1,673:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
Line 1,690 ⟶ 1,692:
{{out}}
<pre>
▲$ sudo nc -l 256 & ./sockets
[199] 10818
hello socket world
|