17 lines
476 B
Plaintext
17 lines
476 B
Plaintext
#!/usr/bin/env clyx
|
|||
|
|
:: _main [
|
||
|
|
"Listening on port 1337..." puts cr
|
||
|
|
1337 nlstn # listen on port 1337
|
||
|
|
1 while [ # outer connection accept loop
|
||
|
|
dup read # accept a new connection -> conn_fd
|
||
|
|
1 # loop condition for client session loop
|
||
|
|
while [
|
||
|
|
dup read # read data
|
||
|
|
dup vlen 0 != # check if data is non-empty
|
||
|
|
if [ over swap write drop 1 ] [ drop 0 ]
|
||
|
|
]
|
||
|
|
close # close the connection socket
|
||
|
|
1 # loop condition for outer server loop
|
||
|
|
]
|
||
|
|
]
|