29 lines
745 B
C++
29 lines
745 B
C++
// WebCamService.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
|
|
//
|
|
//#include <windows.h>
|
|
#include <iostream>
|
|
#include <thread>
|
|
#include <chrono>
|
|
|
|
#include "WebSocketService.h"
|
|
#include "VideoSocketService.h"
|
|
//#pragma comment( linker, "/subsystem:windows /entry:mainCRTStartup" )
|
|
int main()
|
|
{
|
|
HANDLE hMutex = ::CreateMutex(NULL, TRUE, L"WebCamService_dp20220128");//FirstName可以随便取一个唯一的名字
|
|
if(hMutex != NULL){
|
|
if(GetLastError() == ERROR_ALREADY_EXISTS){
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
WebSocketService::getInstance()->Start(9085);
|
|
VideoSocketService::getInstance()->Start(9086);
|
|
while (true)
|
|
{
|
|
std::cout << ".";
|
|
std::this_thread::sleep_for(std::chrono::seconds(60));
|
|
}
|
|
return 0;
|
|
}
|