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

📄 wigtestmain.c

📁 tornado2.0 for PPC VxWorks socket 源代码
💻 C
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -