- int rc;
-
- assert( mSettings->inHostname != NULL );
-
- // The local socket needs to be filled in first, since the
- // IPv6 address testing for the peer depends on the type of
- // the local socket
- SockAddr_localAddr( mSettings );
- SockAddr_remoteAddr( mSettings );
- MakeSocket( mSettings);
- SetSocketOptions( mSettings );
-
- if ( mSettings->mLocalhost != NULL ) {
- // bind socket to local address
- rc = bind( mSettings->mSock, (sockaddr*) &mSettings->local,
- SockAddr_get_sizeof_sockaddr( &mSettings->local ) );
- WARN_errno( rc == SOCKET_ERROR, "bind" );
- }