- strlcpy(this->IP,ip,MAXBUF);
- this->ServerInstance = SI;
- if (this->fd > -1)
- this->ServerInstance->SE->AddFd(this);
-}
-
-BufferedSocket::BufferedSocket(InspIRCd* SI, const std::string &ipaddr, int aport, unsigned long maxtime, const std::string &connectbindip)
-{
- this->cbindip = connectbindip;
- this->fd = -1;
- this->ServerInstance = SI;
- strlcpy(host,ipaddr.c_str(),MAXBUF);
- this->Timeout = NULL;
-
- strlcpy(this->host,ipaddr.c_str(),MAXBUF);
- this->port = aport;
-
- irc::sockets::sockaddrs testaddr;
- if (!irc::sockets::aptosa(host, aport, &testaddr))
- {
- this->ServerInstance->Logs->Log("SOCKET", DEBUG,"BUG: Hostname passed to BufferedSocket, rather than an IP address!");
- this->OnError(I_ERR_CONNECT);
- this->Close();
- this->fd = -1;
- this->state = I_ERROR;
- return;
- }
- else
- {
- strlcpy(this->IP,host,MAXBUF);
- if (!this->DoConnect(maxtime))
- {
- this->OnError(I_ERR_CONNECT);
- this->Close();
- this->fd = -1;
- this->state = I_ERROR;
- return;
- }
- }