X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstreamsocket.cpp;fp=source%2Fstreamsocket.cpp;h=7ede11552aeba1326928e8e845b0eabe23544c6a;hb=5ed4af50473e707d76b22c5394a1ab88be4b3b7c;hp=ed506d6320881c4a4169b54d836da483538510ec;hpb=db63dde92c3f9d73f295a052828c639576ab7c4c;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)