Following code is a socket programming sample for a TCP client.
But when I run this, connect() is returned as Address family not supported by protocol.
I have he
Set the server address like this;
addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr(host); addr.sin_port = htons(port);