Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,23 @@
using Sockets # for version 1.0
println("Echo server on port 12321")
try
server = listen(12321)
instance = 0
while true
sock = accept(server)
instance += 1
socklabel = "$(getsockname(sock)) number $instance"
@async begin
println("Server connected to socket $socklabel")
write(sock, "Connected to echo server.\r\n")
while isopen(sock)
str = readline(sock)
write(sock,"$str\r\n")
println("Echoed $str to socket $socklabel")
end
println("Closed socket $socklabel")
end
end
catch y
println("Caught exception: $y")
end