- else
- {
- strlcpy(this->host,ipaddr.c_str(),MAXBUF);
- this->port = aport;
-
- if (insp_aton(host,&addy) < 1)
- {
- this->Instance->Log(DEBUG,"You cannot pass hostnames to InspSocket, resolve them first with Resolver!");
- this->Close();
- this->fd = -1;
- this->state = I_ERROR;
- this->OnError(I_ERR_RESOLVE);
- return;
- }
- else
- {
- this->Instance->Log(DEBUG,"No need to resolve %s",this->host);
- strlcpy(this->IP,host,MAXBUF);
- timeout_val = maxtime;
- this->DoConnect();
- }
- }
-}
-
-void InspSocket::WantWrite()
-{
- this->Instance->SE->WantWrite(this);
- this->WaitingForWriteEvent = true;
-}
-
-void InspSocket::SetQueues(int nfd)
-{
- // attempt to increase socket sendq and recvq as high as its possible
- int sendbuf = 32768;
- int recvbuf = 32768;
- setsockopt(nfd,SOL_SOCKET,SO_SNDBUF,(const void *)&sendbuf,sizeof(sendbuf));
- setsockopt(nfd,SOL_SOCKET,SO_RCVBUF,(const void *)&recvbuf,sizeof(sendbuf));