X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstreamsocket.cpp;h=7ede11552aeba1326928e8e845b0eabe23544c6a;hb=5ed4af50473e707d76b22c5394a1ab88be4b3b7c;hp=ed506d6320881c4a4169b54d836da483538510ec;hpb=18fd377f86b47234d1598524092167a5930b3e3b;p=libs%2Fnet.git diff --git a/source/streamsocket.cpp b/source/streamsocket.cpp index ed506d6..7ede115 100644 --- a/source/streamsocket.cpp +++ b/source/streamsocket.cpp @@ -33,8 +33,8 @@ bool StreamSocket::connect(const SockAddr &addr) SockAddr::SysAddr sa = addr.to_sys(); + int err = ::connect(priv->handle, reinterpret_cast(&sa.addr), sa.size); #ifdef WIN32 - int err = WSAConnect(priv->handle, reinterpret_cast(&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(&sa.addr), sa.size); if(err==-1) { if(errno==EINPROGRESS)