Danbias/Code/Network/OysterNetworkServer/ServerMain.cpp

55 lines
930 B
C++
Raw Normal View History

2013-11-18 16:47:57 +01:00
#include <iostream>
#include <WinSock2.h>
#include <vector>
2013-11-22 14:23:08 +01:00
#include <vld.h>
#include "../NetworkDependencies/WinsockFunctions.h"
#include "TestClass.h"
using namespace std;
2013-12-10 08:32:08 +01:00
void clientProc(Oyster::Network::NetworkClient* client);
int main()
{
2013-11-26 13:45:03 +01:00
if(!InitWinSock())
{
2013-11-26 13:45:03 +01:00
cout << "errorMessage: unable to start winsock" << endl;
}
2013-12-10 08:32:08 +01:00
Test test;
2013-12-10 08:32:08 +01:00
cout << "Server" << endl;
2013-12-10 08:32:08 +01:00
test.mainLoop();
while(1)
{
//Fetch new clients from the postbox
/*
//Send a message every 1 seconds to all clients.
if(timer.getElapsedSeconds() > 1)
{
cout << "Sending to " << clients.size() << " clients." << endl;
timer.reset();
for(int i = 0; i < (int)clients.size(); i++)
{
clients.at(i)->Send(sendBuffer);
}
}*/
/*//Fetch messages
if(recvPostBox->FetchMessage(recvBuffer))
{
t.Unpack(set, recvBuffer);
2013-12-08 23:56:17 +01:00
//PrintOutMessage(set);
set->Release();
}*/
}
2013-12-10 08:32:08 +01:00
2013-12-04 14:58:15 +01:00
Sleep(1000);
system("pause");
2013-11-22 15:48:49 +01:00
return 0;
}