From ae6e4cf621e8b1180fb87e31fb733ecd9d16aa20 Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Sun, 10 Apr 2016 16:15:18 -0600 Subject: Removed old newconn function New function performs DNS lookup rather than requiring an ip address. Also cleaned up a few other lines --- src/main.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/main.c b/src/main.c index c51bf05..e8ec0d2 100644 --- a/src/main.c +++ b/src/main.c @@ -64,22 +64,6 @@ int newconn(char* addr, char* port) { return socket_desc; } -// int newconn(char* addr, int port) { -// int socket_desc; -// struct sockaddr_in server; -// -// socket_desc = socket(AF_INET, SOCK_STREAM, 0); -// -// server.sin_family = AF_INET; -// server.sin_port = htons(port); -// server.sin_addr.s_addr = inet_addr(addr); -// -// if(connect(socket_desc, (struct sockaddr *)&server, sizeof(server)) < 0) { -// return -1; -// } -// -// return socket_desc; -// } int recv_line(int sockd, char* out) { int i = 0; @@ -197,7 +181,6 @@ int main(int argc, char* argv[]) { int socket_desc; - //socket_desc = newconn("93.95.228.145", 6667); socket_desc = newconn(server, port); if(socket_desc == -1) { @@ -205,10 +188,10 @@ int main(int argc, char* argv[]) { return 1; } - //printf("Connected to %s on port %d\n", addr, port); - irc_auth(socket_desc, "swarley", "swarley"); - //return_ping(socket_desc); + irc_auth(socket_desc, "nullspoon", "nullspoon"); + // Cleanup close(socket_desc); + return 0; } -- cgit v1.2.3