mirror of
https://git.sr.ht/~crc_/retroforth
synced 2024-11-16 19:48:56 +01:00
02bd140c4b
FossilOrigin-Name: 6e7d888e88b952d156f9eb4c905e756a085648cdc94f15f7b2bb31643c570164
31 lines
447 B
Text
31 lines
447 B
Text
Get a socket.
|
|
|
|
~~~
|
|
socket:create 'Sock var-n
|
|
~~~
|
|
|
|
Bind to port 9998.
|
|
|
|
~~~
|
|
'9998 @Sock socket:bind drop-pair
|
|
~~~
|
|
|
|
Prepare to listen for connections.
|
|
|
|
~~~
|
|
#3 @Sock socket:listen drop-pair
|
|
~~~
|
|
|
|
Serve the user some data. This will repeat 5 times, then end.
|
|
|
|
~~~
|
|
#5 [ @Sock socket:accept (discard_error_code: drop )
|
|
'Hello_from_RETRO\n s:format swap [ socket:send drop-pair ] sip socket:close
|
|
] times
|
|
~~~
|
|
|
|
Clean up.
|
|
|
|
~~~
|
|
@Sock socket:close
|
|
~~~
|