- len = sprintf(sendBuf, "USER %s 0 0 :%s\n", client->ident, client->realname);
- write_socket(client, sendBuf, len);
- len = sprintf(sendBuf, "NICK %s\n", client->nick);
- write_socket(client, sendBuf, len);
-
- return 1;
-}
-
-#else
-
-int connect_socket(struct ClientSocket *client) {
- if((client->flags & SOCKET_FLAG_CONNECTED)) return 1;
- struct hostent *host;
- struct sockaddr_in addr;
- int sock;
- if (!inet_aton(client->host, &addr.sin_addr))
- {
- host = gethostbyname(client->host);
- if (!host)
- {
- perror("gethostbyname() failed");
+
+ if(ip6) {
+ sock = socket(AF_INET6, SOCK_STREAM, 0);
+ if(sock == -1) {
+ perror("socket() failed");