Anonymous user
Echo server: Difference between revisions
m
Fixed alphabetic position
(Added PicoLisp) |
m (Fixed alphabetic position) |
||
Line 596:
}</lang>
=={{header|PicoLisp}}==▼
<lang PicoLisp>(setq Port (port 12321))▼
(loop▼
(setq Sock (listen Port)) # Listen▼
(NIL (fork) (close Port)) # Accepted▼
(close Sock) ) # Parent: Close socket and continue▼
# Child:▼
(prinl (stamp) " -- (Pid " *Pid ") Client connected from " *Adr)▼
(in Sock▼
(until (eof) # Echo lines▼
(out Sock (prinl (line))) ) )▼
(prinl (stamp) " -- (Pid " *Pid ") Client disconnected")▼
(bye) # Terminate child</lang>▼
=={{header|Oz}}==
Line 732 ⟶ 714:
}
}</lang>
▲=={{header|PicoLisp}}==
▲<lang PicoLisp>(setq Port (port 12321))
▲(loop
▲ (setq Sock (listen Port)) # Listen
▲ (NIL (fork) (close Port)) # Accepted
▲ (close Sock) ) # Parent: Close socket and continue
▲# Child:
▲(prinl (stamp) " -- (Pid " *Pid ") Client connected from " *Adr)
▲(in Sock
▲ (until (eof) # Echo lines
▲ (out Sock (prinl (line))) ) )
▲(prinl (stamp) " -- (Pid " *Pid ") Client disconnected")
▲(bye) # Terminate child</lang>
=={{header|Python}}==
|