Anonymous user
Hello world/Web server: Difference between revisions
m
→{{header|BaCon}}
m (Fixed capitalization) |
|||
Line 154:
=={{header|BaCon}}==
Requires BaCon 4.2 or higher.
<lang
CONST New$ = CHR$(13) & NL$
CONST Sep$ = CHR$(13) & NL$ & CHR$(13) & NL$
Line 165 ⟶ 166:
' Ignore child signals to avoid zombie processes
SIGNAL SIG_IGN, SIGCHLD
OPEN Ip$ & ":8080" FOR SERVER AS mynet
' Keep receiving requests
WHILE TRUE
' Handle for newly incoming connection
▲ ' Open listening port
' Incoming connection -> create background process
Line 180 ⟶ 184:
' Get the request
REPEAT
RECEIVE dat$ FROM
PRINT dat$
UNTIL RIGHT$(dat$, 4) = Sep$
' Reply that we're OK
SEND "HTTP/1.1 200 Ok" & New$ & "Content-Length: " & STR$(LEN(Msg$)) & Sep$ & Msg$ TO
' Close connection
Line 191 ⟶ 195:
' End this process
ENDIF
WEND</lang>
=={{header|BBC BASIC}}==
|