-BufferedSocketError BufferedSocket::BeginConnect(const std::string& ipaddr, int aport, unsigned int maxtime, const std::string& connectbindip)
-{
- irc::sockets::sockaddrs addr, bind;
- if (!irc::sockets::aptosa(ipaddr, aport, addr))
- {
- ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "BUG: Hostname passed to BufferedSocket, rather than an IP address!");
- return I_ERR_CONNECT;
- }
-
- bind.sa.sa_family = 0;
- if (!connectbindip.empty())
- {
- if (!irc::sockets::aptosa(connectbindip, 0, bind))
- {
- return I_ERR_BIND;
- }
- }
-
- return BeginConnect(addr, bind, maxtime);
-}
-