Windows Sockets 1.1应用实例(143)

2010-12-30 20:58:11 · 作者: · 浏览: 62959
nbsp;  wshout_err (hOurDlg, WSAGetLastError(), "bind()");

       return (SOCKET) -1;

    }

   

    if (iProto == iUDP)

       return (hSock);

   

    /* If iProto == iTCP, then must listen() and accept() also */

 

    ret = listen(hSock, 0);        /* listen on the socket */

    if (ret == SOCKET_ERROR){   /* listen() failed           */

       wshout_err (hOurDlg, WSAGetLastError(), "listen()");

       return (SOCKET) -1;

    }

   

    return(hSock);

}

 

/* eof */