using irc::sockets::insp_ntoa;
using irc::sockets::insp_aton;
using irc::sockets::OpenTCPSocket;
+using irc::sockets::NonBlocking;
/** Masks to mask off the responses we get from the DNSRequest methods
*/
/* Initialize mastersocket */
int s = OpenTCPSocket(ServerInstance->Config->DNSServer, SOCK_DGRAM);
this->SetFd(s);
+ NonBlocking(s);
/* Have we got a socket and is it nonblocking? */
if (this->GetFd() != -1)
#endif
const char* ipaddr_from;
unsigned short int port_from = 0;
-#ifdef USING_IOCP
- /** Dirty hack for IOCP UDP sockets **/
- udp_overlap * ov = ((IOCPEngine*)ServerInstance->SE)->udp_ov;
- memcpy(buffer, ov->udp_buffer, ov->udp_len);
- memcpy(from, ov->udp_sockaddr, ov->udp_sockaddr_len);
- int length = ov->udp_len;
-#else
- int length = recvfrom(this->GetFd(),(char*)buffer,sizeof(DNSHeader),0,from,&x);
-#endif
+
+ void* m_readEvent = NULL;
+ GetExt("windows_readevent", m_readEvent);
+
+ int length = _recvfrom(this->GetFd(),(char*)buffer,sizeof(DNSHeader),0,from,&x);
/* Did we get the whole header? */
if (length < 12)
* as the last parameter on the line with a value ":1".
*/
if (*formatted == ':')
- resultstr = "0" + resultstr;
+ resultstr.insert(0, "0");
}
break;