using namespace Framework;
using namespace log4cplus;
using namespace std;
using namespace TcpSocketServerSide;
using namespace Business;
using namespace Business::Handlers;
int _tmain(int argc, _TCHAR* argv[])
{
Framework::WSAInitializor init;
ITaskFactory* taskFactory = new DefaultTaskFactory(1);
SocketServer* server = new TcpSocketServer(
"192.168.1.103",
8888,
taskFactory
);
auto dispatcher = new TcpSocketEventDispatcher(*server);
auto socketFactory = new TcpSocketFactory();
auto manager = new TcpConnectionManager(*server, *dispatcher, *socketFactory);
auto handler = new WhisperSocketEventHandler(*server);
auto serverEventHandler =
new WhisperSocketEventHandler::ServerEventHandler(
*server,
*handler
);
/* register message handler */
PacketDispatcher& packetDispatcher = handler->GetPacketDispatcher();
packetDispatcher.Register(new AuthenticateRequestHandler());
/* register message handler */
server->SetSocketEventDispatcher(dispatcher);
server->SetConnectionManager(manager);
server->SetSocketEventHandler(handler);
server->SetServerEventHandler(serverEventHandler);
server->Start();
/*Sleep(10*1000);*/
//server->Shutdown();
server->WaitForShutdown();
/// ......
return 0;
}
-
Notifications
You must be signed in to change notification settings - Fork 5
xsyr/IOCompletionPort
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published