2019-06-06 19:20:03 +02:00
|
|
|
Get a socket.
|
|
|
|
|
|
|
|
~~~
|
2020-06-29 21:07:57 +02:00
|
|
|
socket:create 'Sock var-n
|
2019-06-06 19:20:03 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
Bind to port 9998.
|
|
|
|
|
|
|
|
~~~
|
2019-06-06 20:46:08 +02:00
|
|
|
'9998 @Sock socket:bind drop-pair
|
2019-06-06 19:20:03 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
Prepare to listen for connections.
|
|
|
|
|
|
|
|
~~~
|
|
|
|
#3 @Sock socket:listen drop-pair
|
|
|
|
~~~
|
|
|
|
|
2022-04-11 18:22:43 +02:00
|
|
|
Serve the user some data.
|
2019-06-06 19:20:03 +02:00
|
|
|
|
|
|
|
~~~
|
2022-04-11 18:22:43 +02:00
|
|
|
[ @Sock socket:accept (discard_error_code: drop )
|
2019-06-06 19:20:03 +02:00
|
|
|
'Hello_from_RETRO\n s:format swap [ socket:send drop-pair ] sip socket:close
|
2022-04-11 18:22:43 +02:00
|
|
|
] forever
|
2019-06-06 19:20:03 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
Clean up.
|
|
|
|
|
|
|
|
~~~
|
|
|
|
@Sock socket:close
|
|
|
|
~~~
|