core :: union_find
union–find algorithm using an efficient disjoint-set data structure
# Client sample using the Socket module which connect to the server sample.
module socket_client
import socket
if args.length < 2 then
print "Usage : socket_client <host> <port>"
exit 1
end
var address = args[0]
var port = args[1].to_i
# Open a conection with the server
var s = new TCPStream.connect(address, port)
printn "Connecting to {s.host}:{s.port} at {s.address}... "
print if s.connected then "Connected" else "Connection failed"
if s.connected then
# Communicate
s.write "Hello server!\n"
print s.read_line
s.write "Bye server!\n"
print s.read_line
s.close
end
lib/socket/examples/socket_client.nit:17,1--43,3