Add socket operations
This commit is contained in:
8
examples/echoclient.monkey
Normal file
8
examples/echoclient.monkey
Normal file
@@ -0,0 +1,8 @@
|
||||
#!./monkey-lang
|
||||
|
||||
fd := socket("tcp4")
|
||||
bind(fd, "127.0.0.1:32535")
|
||||
connect(fd, "127.0.0.1:8000")
|
||||
write(fd, "Hello World")
|
||||
print(read(fd))
|
||||
close(fd)
|
||||
Reference in New Issue
Block a user