all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
16
Task/Sockets/Haskell/sockets-3.hs
Normal file
16
Task/Sockets/Haskell/sockets-3.hs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
procedure main(arglist) #: usage socket port hostname or socket port
|
||||
hello(arglist[2]|"",arglist[1])
|
||||
end
|
||||
|
||||
procedure hello(host,port)
|
||||
local s
|
||||
/host := ""
|
||||
host ||:= ":"
|
||||
host ||:= 0 < 65536 > port | runerr(103,port)
|
||||
if s := open(host,"n") then {
|
||||
write(s, "hello socket world.")
|
||||
close(s)
|
||||
}
|
||||
else stop("Unable to connect to ",host,":",port)
|
||||
return
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue