wigtestmain.c

来自「tornado2.0 for PPC VxWorks socket 源代码」· C语言 代码 · 共 65 行

C
65
字号
#ifdef	__cplusplus
extern "C"{
#endif

#include <vxWorks.h>
#include <stdio.h>
#include <stdlib.h>
#include <taskLib.h>
#include <sysLib.h>
#include "wigtest.h"
#include <sockLib.h>
#include <socklib.h>
#include <ioLib.h >
#include <socket.h>
#include <sysLib.h>
#include <logLib.h>
#include <errno.h>
#include <string.h>
#include "wdLib.h"
#include "in.h"		
#include "ioLib.h"




int NTidList;/*任务ID*/
int nPortNum = 4793;/*port number*/
char *szpHostName = "190.168.99.150";
int nResult = 0; 
  	/*任务入口主函数*/
 	int testmain(void)
	{
		
		nResult = socketservice(nPortNum, 1000, 16000);
                printf("nResult = %d\n", nResult);
	
		return 0;	
	}
   
   /*创建任务函数*/
	int test(void)
	{
		printf("test create begin!\n");
		
		/*创建任务*/
		NTidList = taskSpawn("tTest", 90, VX_FP_TASK, 20000,	
		          (FUNCPTR)testmain, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
		
		/*判断任务是否创建成功*/
		if (-1 != NTidList)
		{
		 	printf("test create ok!\n");
			return (0);
		}
	 else
	 	{
		 	printf("test create fail!\n");
		  return (-1);
		}
	}

#ifdef	__cplusplus
}
#endif	/* end of __cplusplus */

⌨️ 快捷键说明

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