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

📄 step2.cpp

📁 mini http server,可以集成嵌入到程序中,实现简单的web功能
💻 CPP
字号:

/*
 * Step9:
 * Program exit by catching signal and killing the main thread.
 */

#include <iostream.h>
#include <stdlib.h>
#include <windows.h>

#include "Pi2API.h"
#include "TestAPI.h"

void MessageHandler()
{
	MSG tMsg;
	while( GetMessage( &tMsg, NULL, 0, 0 ) )
		{
		TranslateMessage( &tMsg );
		DispatchMessage( &tMsg );
		};

//	cout << "Signal #" << iSignal << endl;
//	PIThread_terminate( PIThread_getMain(), 37 );
}

int iRet;
void Step2( PIDB * )
{
//	signal( SIGTERM, Handler );
//	signal( SIGINT, Handler );
//	iRet = 0;
//	for(; !iDie;)	{}
//	iRet = -1;
	MessageHandler();
}

int main()
{
	if ( PIProgram_enter( "dummy", PIPROGRAM_VERSION_1_0, Step2 ) )
		{
		cout << "Program_enter() failed." << endl;
		FAILED(99);
		exit( 1 );
		};
	OK;

	return iRet;
}

⌨️ 快捷键说明

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