0e9cd203c0
FossilOrigin-Name: eff70d440e8ebc4a9c9ff895f4a01219a05b4dda4aa11301baa3536ddebbc641
31 lines
410 B
Forth
31 lines
410 B
Forth
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.
|
|
|
|
~~~
|
|
[ @Sock socket:accept (discard_error_code: drop )
|
|
'Hello_from_RETRO\n s:format swap [ socket:send drop-pair ] sip socket:close
|
|
] forever
|
|
~~~
|
|
|
|
Clean up.
|
|
|
|
~~~
|
|
@Sock socket:close
|
|
~~~
|