2013-12-06 10:45:53 +01:00
|
|
|
#ifndef OYSTER_NETWORK_SERVER_I_SERVER_H
|
|
|
|
#define OYSTER_NETWORK_SERVER_I_SERVER_H
|
|
|
|
|
|
|
|
/////////////////////////////////////
|
|
|
|
// Created by Pontus Fransson 2013 //
|
|
|
|
/////////////////////////////////////
|
|
|
|
|
2013-12-08 23:56:17 +01:00
|
|
|
#include "IClient.h"
|
2013-12-06 10:45:53 +01:00
|
|
|
|
2013-12-08 23:56:17 +01:00
|
|
|
namespace Oyster
|
|
|
|
{
|
|
|
|
namespace Network
|
2013-12-06 10:45:53 +01:00
|
|
|
{
|
2013-12-08 23:56:17 +01:00
|
|
|
namespace Server
|
|
|
|
{
|
|
|
|
class IServer
|
|
|
|
{
|
|
|
|
class ISession;
|
|
|
|
public:
|
|
|
|
struct INIT_DESC
|
|
|
|
{
|
|
|
|
unsigned short port; //Port the server should be accepting clients on.
|
|
|
|
void (*proc)(IClient*);
|
|
|
|
};
|
|
|
|
|
|
|
|
IServer();
|
|
|
|
virtual ~IServer();
|
|
|
|
|
|
|
|
virtual bool Init(INIT_DESC& initDesc);
|
|
|
|
virtual bool Start();
|
|
|
|
virtual bool Stop();
|
|
|
|
virtual bool Shutdown();
|
|
|
|
|
|
|
|
virtual void AddSession(ISession* session);
|
|
|
|
virtual void RemoveSession(ISession* session);
|
|
|
|
|
|
|
|
virtual bool IsStarted() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct PrivateData;
|
|
|
|
PrivateData* privateData;
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-12-06 10:45:53 +01:00
|
|
|
|
|
|
|
#endif
|