/**
|
|
* @file P2PServer.h
|
|
*
|
|
* Created on: 17.01.2017
|
|
* @author Piotr Dergun
|
|
*/
|
|
|
|
#ifndef P2PSERVER_H_
|
|
#define P2PSERVER_H_
|
|
|
|
#include "common.h"
|
|
#include "Node.h"
|
|
#include "Simulation.h"
|
|
|
|
class P2PServer : public Node
|
|
{
|
|
/** adres IP seeda */
|
|
string seedIp;
|
|
/** adres IP peera */
|
|
string peerIp;
|
|
/** port seeda */
|
|
int seedPort;
|
|
/** port peera */
|
|
int peerPort;
|
|
Simulation *sim;
|
|
|
|
public:
|
|
P2PServer();
|
|
P2PServer(string hostname, string ip, string mask);
|
|
virtual ~P2PServer();
|
|
|
|
/**
|
|
* obsługuje przychodzące pakiety do serwera oraz zwraca do seeda
|
|
* informacje o adresie IP i otwartym porcie peera
|
|
*/
|
|
virtual void onRecv();
|
|
|
|
/* mutuatory */
|
|
const Simulation* getSim();
|
|
void setSim(Simulation* sim);
|
|
};
|
|
|
|
#endif /* P2PSERVER_H_ */
|