stk-code_catmod/dev/SocketsBase/network_manager.hpp
hilnius d933eae338 base commit
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@12865 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-06-16 23:54:02 +00:00

32 lines
761 B
C++

#ifndef NETWORKMANAGER_HPP
#define NETWORKMANAGER_HPP
#include "stk_peer.hpp"
#include "stk_host.hpp"
#include <vector>
#include "protocol_listener.hpp"
class NetworkManager
{
public:
NetworkManager();
virtual ~NetworkManager();
virtual void run() = 0;
static void sendRawPacket(uint8_t* data, int length, unsigned int dstIp, unsigned short dstPort);
static uint8_t* receiveRawPacket();
static void receptionCallback(char* data);
virtual void packetReceived(char* data) = 0;
STKHost* getHost();
protected:
std::vector<STKPeer*> m_peers;
STKHost* m_localhost;
static NetworkManager* instance;
};
#endif // NETWORKMANAGER_HPP