-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.cpp
31 lines (25 loc) · 829 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <RLib_LibImport.h>
#include "IISExpress.h"
#include "IISExpress.hpp" // include once
//-------------------------------------------------------------------------
static volatile long stoping = FALSE;
static IISExpress server;
RLIB_STATIC({
server.IsAborted = [](IISExpress *)->bool {
return stoping != FALSE;
};
});
//-------------------------------------------------------------------------
void main()
{
ManagedObject<ThreadPool> pool = pool.construct();
server.AssociateWithThreadPool(pool);
server.Port = static_cast<USHORT>(8080);
server.IpAddress = 0U; // Sockets::Ipv4StringToAddress(_T("0.0.0.0"));
StringCopyTo(Path::ToNtPath(AppBase::GetStartupPath()), server.RootDirectory);
// begins to loop
if (server.SatisfiesPrecondition()) {
server.Start();
server.Listener.Finalize();
} //if
}