⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bw_sunrpc_client.c

📁 经典的linux源码
💻 C
字号:
#include	"unpipc.h"#include	"bw_sunrpc.h"void	*buf;int		totalnbytes, xfersize;intmain(int argc, char **argv){	int		i, nloop, ntowrite;	CLIENT	*cl;	data_in	in;	if (argc != 6)		err_quit("usage: bw_sunrpc_client <hostname> <#loops>"				 " <#mbytes> <#bytes/write> <protocol>");	nloop = atoi(argv[2]);	totalnbytes = atoi(argv[3]) * 1024 * 1024;	xfersize = atoi(argv[4]);	buf = Valloc(xfersize);	Touch(buf, xfersize);	cl = Clnt_create(argv[1], BW_SUNRPC_PROG, BW_SUNRPC_VERS, argv[5]);	Start_time();	for (i = 0; i < nloop; i++) {		ntowrite = totalnbytes;		while (ntowrite > 0) {			in.data.data_len = xfersize;			in.data.data_val = buf;			if (bw_sunrpc_1(&in, cl) == NULL)				err_quit("%s", clnt_sperror(cl, argv[1]));			ntowrite -= xfersize;		}	}	printf("bandwidth: %.3f MB/sec\n",		   totalnbytes / Stop_time() * nloop);	exit(0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -