CAsyncSocket::Connect

This method establishes a connection to an unconnected stream or datagram socket. If the socket is unbound, the system assigns unique values to the local association, and the socket is marked as bound. If the address member of the name structure is all zeroes, Connect will return zero. To get extended error information, call the GetLastError function.

At a Glance

Header file: Afxsock.h
Platforms: H/PC 2.0, Palm-size PC, H/PC Pro
Windows CE versions: 2.0 and later
Complete documentation: Visual C++ documentation

Syntax

BOOL Connect( LPCTSTR lpszHostAddress, UINT nHostPort );

BOOL Connect( const SOCKADDR* lpSockAddr, int nSockAddrLen );

See Also

CAsyncSocket::Accept, CAsyncSocket::CAsyncSocket, CAsyncSocket::IOCtl, CAsyncSocket::GetSockOpt, CAsyncSocket::SetSockOpt, GetLastError