Windows Sockets 1.1应用实例(九十八)

2010-12-30 20:58:11 · 作者: · 浏览: 63061
f */

 

3.4.3.4 ushout.c清单

/*

 * 文件名: USHOUT.C

 */

 

#include "wshout.h"

 

/* MSC Include files: */

#include <stdio.h>

#include <io.h>

#include <string.h>

#include <stdlib.h>

#include <time.h>

 

/* Returns the number of bytes written */

long UWriteData(SOCKET hSock, HWND hOurDlg, int send_len)

{

    int counter;

    static int DataBuffer[BUF_SIZE];  /* Buffer to hold generated data   */

    static  char ReplyBuffer[512];    /* Buffer to hold any reply rcvd  */

    long bytes_sent = 0L;          /* Counter of bytes on connection    */

    long total_len = 1024L*1024L;     /* Total # of bytes to generate   */

    time_t start, end;             &n