Windows Sockets 1.1应用实例(106)

2010-12-30 20:58:11 · 作者: · 浏览: 63041
/* # of bytes placed on connection */

       wsprintf((LPSTR)prbuf,"%ld\n",write_count);

       SetDlgItemText(hOurDlg, IDD_WRITE, (LPSTR) prbuf);

 

       wsprintf((LPSTR)prbuf,"%ld\n",bytes_sent);

       SetDlgItemText(hOurDlg, IDD_SENT, (LPSTR) prbuf);

    } /* end while */

   

    /* Look for a reply ... NOTE: most hosts won't give

     * a 'reply', done to illustrate communication between

     * sockets. Our ulisten example will give a reply though.

     */

   

    SetDlgItemText(hOurDlg, IDD_COMMENT, "Waiting for reply from server..\n");

    while (1) {

       tmp = sizeof(dest);

       i_temp = recvfrom(hSock,(char FAR *) &ReplyBuffer,sizeof(R