diff options
Diffstat (limited to 'agni.c')
-rw-r--r-- | agni.c | 21 |
1 files changed, 3 insertions, 18 deletions
@@ -23,6 +23,9 @@ #include "buf.h" #include "mq_cmd.h" #include "tbl_qcmd.h" +#include "util.h" +#include "sock_conn.h" +#include "irc_parse.h" /* no defence programming, no error checking, no argument checking just PoC @@ -31,24 +34,6 @@ nothing else #define MQ_MSG_SIZE 8192 -/* -return fd!=ifconnection there -*/ -int irc_connect( char *hostname, char *port ) -{ - int fd=0; - - struct addrinfo serv, *res; - - memset(&serv, 0, sizeof(serv)); - serv.ai_family = AF_INET; - serv.ai_socktype = SOCK_STREAM; - getaddrinfo(hostname, port, &serv, &res); - fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); - connect(fd, res->ai_addr, res->ai_addrlen); - - return fd; -} /* return unique ID, with atomic counter should work in all cases |