Windows Sockets 1.1应用实例(115)

2010-12-30 20:58:11 · 作者: · 浏览: 63022
nbsp; } /* end: if (bytes_read) */

     else {

        wsprintf((LPSTR)prbuf, "Timed out. No data received.\n");

        SetDlgItemText(hOurDlg, IDD_COMMENT, prbuf);

        goto come_here;

     } /* end: else */

    

     /* send reply to 'client' */

     wsprintf((LPSTR)prbuf,

        "Replied to %s\n", inet_ntoa(local.sin_addr));

     SetDlgItemText(hOurDlg, IDD_COMMENT, prbuf);

    

     for (i=0; i<10; ++i) {

        sprintf(SendBuf, "Rec'd %ld bytes.\n", bytes_read);

        if(len = sendto(hSock, SendBuf, sizeof(SendBuf), 0,

             &nbs