]> git.tdb.fi Git - libs/net.git/commitdiff
There's no good reason to prefer WASConnect over connect
authorMikko Rasa <tdb@tdb.fi>
Sat, 6 Aug 2011 20:40:33 +0000 (23:40 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 6 Aug 2011 20:40:33 +0000 (23:40 +0300)
source/streamsocket.cpp

index ed506d6320881c4a4169b54d836da483538510ec..7ede11552aeba1326928e8e845b0eabe23544c6a 100644 (file)
@@ -33,8 +33,8 @@ bool StreamSocket::connect(const SockAddr &addr)
 
        SockAddr::SysAddr sa = addr.to_sys();
 
+       int err = ::connect(priv->handle, reinterpret_cast<sockaddr *>(&sa.addr), sa.size);
 #ifdef WIN32
-       int err = WSAConnect(priv->handle, reinterpret_cast<sockaddr *>(&sa.addr), sa.size, 0, 0, 0, 0);
        if(err==SOCKET_ERROR)
        {
                int err_code = WSAGetLastError();
@@ -48,7 +48,6 @@ bool StreamSocket::connect(const SockAddr &addr)
                        throw system_error("connect", err_code);
        }
 #else
-       int err = ::connect(priv->handle, reinterpret_cast<sockaddr *>(&sa.addr), sa.size);
        if(err==-1)
        {
                if(errno==EINPROGRESS)