diff --git a/main.c b/main.c index af8254b..698c775 100644 --- a/main.c +++ b/main.c @@ -80,7 +80,11 @@ pthread_mutex_init(&chanMutex, NULL); - sConnect(SERVER_HOST,SERVER_PORT); + if (sConnect(1,TUVE_SERVER_HOST,TUVE_SERVER_PORT)) + writeLog(0,"TUve Bridge Unable To Connect To TUve Network"); + + if (sConnect(2,IRC_SERVER_HOST,IRC_SERVER_PORT)) + writeLog(0,"TUve Bridge Unable To Connect To IRC Network"); while (1) { diff --git a/socket.c b/socket.c index 4023220..0c12599 100644 --- a/socket.c +++ b/socket.c @@ -19,7 +19,7 @@ int mySocket = 0x0; int connected = 0x0; -int sConnect(const char *host,int port) { +int sConnect(int net,const char *host,int port) { struct sockaddr_in rmAddr; // remote address information struct hostent *hp; int att; diff --git a/tuvebridge.h b/tuvebridge.h index f7df5a2..f610934 100644 --- a/tuvebridge.h +++ b/tuvebridge.h @@ -14,8 +14,10 @@ #include -#define SERVER_HOST "127.0.0.1" //"Ivorytower.UbixOnline.com" -#define SERVER_PORT 9999 +#define TUVE_SERVER_HOST "127.0.0.1" //"Ivorytower.UbixOnline.com" +#define TUVE_SERVER_PORT 9999 +#define IRC_SERVER_HOST "us.undernet.org" +#define IRC_SERVER_PORT 6667 #define NUM_THREADS 2 #define MYPORT 9999 // the port users will be connecting to @@ -70,8 +72,9 @@ /* Global variables very not safe */ +extern int tuveSocket; +extern int ircSocket; -extern int mySocket; extern int connected; extern pthread_mutex_t chanMutex; extern botChanList_t *chans;