Sockets: Difference between revisions
Content deleted Content added
m omit reason |
m Unicon/Icon consistency 2 |
||
Line 523: | Line 523: | ||
#! The actual server |
#! The actual server |
||
[ " hello socket world" server.send ] 256 server.start</lang> |
[ " hello socket world" server.send ] 256 server.start</lang> |
||
=={{header|Unicon}}== |
|||
Unicon integrated TCP/IP networking and messaging. |
|||
<lang unicon>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</lang> |
|||
=={{header|UnixPipes}}== |
=={{header|UnixPipes}}== |