diff options
author | Aaron Ball <nullspoon@iohq.net> | 2016-04-10 16:15:18 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@iohq.net> | 2016-04-10 16:15:18 -0600 |
commit | ae6e4cf621e8b1180fb87e31fb733ecd9d16aa20 (patch) | |
tree | c20a28d84e5c3f3b0e98afd7cd0ffa1e009893e0 | |
parent | 0665e6c4e3c69b461a6a3561065235f51e3bb2f5 (diff) | |
download | ircbot-ae6e4cf621e8b1180fb87e31fb733ecd9d16aa20.tar.gz ircbot-ae6e4cf621e8b1180fb87e31fb733ecd9d16aa20.tar.xz |
Removed old newconn function
New function performs DNS lookup rather than requiring an ip address.
Also cleaned up a few other lines
-rw-r--r-- | src/main.c | 23 |
1 files changed, 3 insertions, 20 deletions
@@ -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; } |