lots o fixes
This commit is contained in:
12
examples/echoserver.m
Normal file
12
examples/echoserver.m
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env monkey-lang
|
||||
|
||||
fd := socket("tcp4")
|
||||
bind(fd, "0.0.0.0:8000")
|
||||
listen(fd, 1)
|
||||
|
||||
while (true) {
|
||||
nfd := accept(fd)
|
||||
msg := read(nfd)
|
||||
write(nfd, msg)
|
||||
close(nfd)
|
||||
}
|
||||
Reference in New Issue
Block a user