CAsyncSocket::Bind

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.

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 Bind( UINT nSocketPort, LPCTSTR lpszSocketAddress = NULL );

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

See Also

CAsyncSocket::Connect, CAsyncSocket::Listen, CAsyncSocket::GetSockName, CAsyncSocket::SetSockOpt, CAsyncSocket::Create