Sockets: Difference between revisions

Content added Content deleted
(→‎{{header|Erlang}}: The Erlang version was a server that the other programs could connect to, corrected it to be a client instead)
(→‎{{header|Erlang}}: Fixed string...)
Line 265: Line 265:
{ok, Sock} = gen_tcp:connect("localhost", 256,
{ok, Sock} = gen_tcp:connect("localhost", 256,
[binary, {packet, 0}]),
[binary, {packet, 0}]),
ok = gen_tcp:send(Sock, "Some Data"),
ok = gen_tcp:send(Sock, "hello socket world"),
ok = gen_tcp:close(Sock).
ok = gen_tcp:close(Sock).
</lang>
</lang>