|
|
|
|
@ -3,13 +3,9 @@
|
|
|
|
|
#include <netdb.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <atomic>
|
|
|
|
|
|
|
|
|
|
#include "IRCClient.h"
|
|
|
|
|
#include "IRCutils.h"
|
|
|
|
|
#include "../TCPReaderWriterClient.h"
|
|
|
|
|
|
|
|
|
|
std::atomic<int> ircsocketfamily;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IRCClient::IRCClient(IRCApplication *app, const std::string &update_channel, const std::string &hostName, unsigned int port, const std::string &callsign, const std::string &password, const std::string &versionInfo)
|
|
|
|
|
@ -58,7 +54,7 @@ void IRCClient::Entry()
|
|
|
|
|
|
|
|
|
|
int state = 0;
|
|
|
|
|
int timer = 0;
|
|
|
|
|
socklen_t optlen = sizeof(int);
|
|
|
|
|
socklen_t optlen;
|
|
|
|
|
|
|
|
|
|
while (true) {
|
|
|
|
|
|
|
|
|
|
@ -85,8 +81,8 @@ void IRCClient::Entry()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
|
|
|
|
|
|
getsockopt(ircSock.GetFD(), SOL_SOCKET, SO_DOMAIN, &ircsocketfamily, &optlen);
|
|
|
|
|
optlen = sizeof(int);
|
|
|
|
|
getsockopt(ircSock.GetFD(), SOL_SOCKET, SO_DOMAIN, &family, &optlen);
|
|
|
|
|
recvQ = new IRCMessageQueue();
|
|
|
|
|
sendQ = new IRCMessageQueue();
|
|
|
|
|
|
|
|
|
|
@ -174,3 +170,8 @@ void IRCClient::Entry()
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int IRCClient::GetFamily()
|
|
|
|
|
{
|
|
|
|
|
return family;
|
|
|
|
|
}
|
|
|
|
|
|