This method associates a local address with the socket. Before it can accept connection requests, a listening server socket must select a port number and make it known to Windows Sockets by calling Bind. Bind establishes the local host address and port number of the socket by assigning a local name to an unnamed socket.
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 |
BOOL Bind( UINT nSocketPort, LPCTSTR lpszSocketAddress = NULL );
BOOL Bind ( const SOCKADDR* lpSockAddr, int nSockAddrLen );
CAsyncSocket::Connect, CAsyncSocket::Listen, CAsyncSocket::GetSockName, CAsyncSocket::SetSockOpt, CAsyncSocket::Create