Danbias/Code/Network/NetworkAPI/NetworkServer.h

54 lines
1.1 KiB
C
Raw Normal View History

2013-12-10 08:32:08 +01:00
#ifndef NETWORK_API_NETWORK_SERVER_H
#define NETWORK_API_NETWORK_SERVER_H
/////////////////////////////////////
// Created by Pontus Fransson 2013 //
/////////////////////////////////////
#ifdef CUSTOM_NET_PROTOCOL_EXPORT
#define NET_PROTOCOL_EXPORT __declspec(dllexport)
#else
#define NET_PROTOCOL_EXPORT __declspec(dllimport)
#endif
#include "NetworkClient.h"
#include "NetworkCallbackHelper.h"
2013-12-13 23:47:16 +01:00
#include <vld.h>
2013-12-10 08:32:08 +01:00
namespace Oyster
{
namespace Network
{
extern "C"
2013-12-10 08:32:08 +01:00
{
class NET_PROTOCOL_EXPORT NetworkServer
2013-12-10 08:32:08 +01:00
{
public:
struct INIT_DESC
2013-12-10 08:32:08 +01:00
{
unsigned short port; //Port the server should be accepting clients on.
NetworkClientCallbackType callbackType; //The recieverObject type. Function or object.
RecieverObject recvObj; //The functions that is called when a new client has connected.
};
2013-12-10 08:32:08 +01:00
NetworkServer();
virtual ~NetworkServer();
2013-12-10 08:32:08 +01:00
bool Init(INIT_DESC& initDesc);
bool Start();
void Stop();
void Shutdown();
2013-12-10 08:32:08 +01:00
bool IsStarted() const;
2013-12-10 08:32:08 +01:00
private:
struct PrivateData;
PrivateData* privateData;
2013-12-10 08:32:08 +01:00
};
2013-12-10 08:32:08 +01:00
}
}
}
#endif