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

📄 ttcp-r.c

📁 T-kernel Tcp/ip Protocol Stack Sample
💻 C
字号:
/**************************************************************************** *   Copyright (C) 2001-2004 MITSUBISHI ELECTRIC CORPORATION and *   RENESAS SOLUTIONS CORPORATION and *   RENESAS TECHNOLOGY CORPORATION *   All Rights Reserved. * *   Performance test program used for TCP/IP subsystem. ****************************************************************************/#include <tk/tkernel.h>#include <renesas_tcpip.h>#include <renesas_tcpip_common.h>extern long ttcp(int, int, int, int, int, short, int, int, char *, int);voidtest_task(int stacd, void *exinf){	int i, trans;	long kb, result;	int testno;	int cnt, len;/***ttcp(trans,nodelay,nbuf,buflen,sinkmode,port,bufalign,bufoffset,host,b_flag)     arg1 ,arg2   ,arg3,arg4  ,arg5,   ,arg6,arg7    ,arg8     ,arg9,arg10***/	errno = 0;	trans = 0;		/* receive */	cnt = 2048; len = 8192;#ifdef SIZE_64	cnt = 2048; len = 64;#endif#ifdef SIZE_128	cnt = 2048; len = 128;#endif#ifdef SIZE_256	cnt = 2048; len = 256;#endif#ifdef SIZE_512	cnt = 2048; len = 512;#endif#ifdef SIZE_1K	cnt = 2048; len = 1024;#endif#ifdef SIZE_2K	cnt = 2048; len = 2048;#endif#ifdef SIZE_4K	cnt = 2048; len = 4096;#endif#ifdef SIZE_8K	cnt = 2048; len = 8192;#endif#ifdef SIZE_16K	cnt = 1024; len = 16384;#endif#ifdef SIZE_32K	cnt = 512; len = 32768;#endif#ifdef SIZE_64K	cnt = 256; len = 65536;#endif	result = ttcp(trans, 0, cnt, len, 0, 0, 4, 0, NULL, 0);#if defined(KPR_ON)	printf("TCP receive throughput: cnt=%4d, len=%5d, total=%8d, perf=%8d B/sec (%8d KB/sec)\n",		cnt, len, cnt * len, result, result / 1024);#endif#if defined(T_KERNEL)	tk_ext_tsk();#endif}/* EOF */

⌨️ 快捷键说明

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