2013-11-18 16:47:57 +01:00
|
|
|
#include <iostream>
|
2013-11-28 16:15:28 +01:00
|
|
|
#include <vector>
|
2013-11-22 14:23:08 +01:00
|
|
|
#include <vld.h>
|
2013-11-25 20:27:23 +01:00
|
|
|
#include "../NetworkDependencies/WinsockFunctions.h"
|
2013-12-16 08:59:38 +01:00
|
|
|
#include "../NetworkAPI/NetworkServer.h"
|
2013-11-19 13:42:50 +01:00
|
|
|
|
2013-12-16 08:59:38 +01:00
|
|
|
using namespace Oyster::Network;
|
2013-11-25 20:27:23 +01:00
|
|
|
using namespace std;
|
2013-11-21 13:42:38 +01:00
|
|
|
|
2013-12-16 08:59:38 +01:00
|
|
|
void proc(NetworkClient client)
|
|
|
|
{
|
|
|
|
cout << "Hej" << endl;
|
|
|
|
}
|
|
|
|
|
2013-11-18 16:34:50 +01:00
|
|
|
int main()
|
2013-12-06 10:45:53 +01:00
|
|
|
{
|
2013-12-16 08:59:38 +01:00
|
|
|
NetworkServer server;
|
|
|
|
Oyster::Network::NetworkServer::INIT_DESC desc;
|
|
|
|
desc.port = 15151;
|
|
|
|
desc.callbackType = NetworkClientCallbackType_Function;
|
|
|
|
desc.recvObj = proc;
|
|
|
|
|
|
|
|
if(!server.Init(desc))
|
|
|
|
{
|
|
|
|
cout << "Init failed" << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!server.Start())
|
2013-11-19 13:42:50 +01:00
|
|
|
{
|
2013-12-16 08:59:38 +01:00
|
|
|
cout << "Start failed" << endl;
|
|
|
|
return 0;
|
2013-11-19 13:42:50 +01:00
|
|
|
}
|
2013-12-09 22:22:05 +01:00
|
|
|
|
2013-12-16 08:59:38 +01:00
|
|
|
cout << "Server started" << endl;
|
|
|
|
|
|
|
|
while(1)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-12-03 23:12:48 +01:00
|
|
|
system("pause");
|
2013-11-22 15:48:49 +01:00
|
|
|
|
2013-12-03 23:12:48 +01:00
|
|
|
return 0;
|
|
|
|
}
|