Symulacja NAT na przedmiot Symulacje Komputerowe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
748 B

  1. /**
  2. * @file P2PServer.h
  3. *
  4. * Created on: 17.01.2017
  5. * @author Piotr Dergun
  6. */
  7. #ifndef P2PSERVER_H_
  8. #define P2PSERVER_H_
  9. #include "common.h"
  10. #include "Node.h"
  11. #include "Simulation.h"
  12. class P2PServer : public Node
  13. {
  14. /** adres IP seeda */
  15. string seedIp;
  16. /** adres IP peera */
  17. string peerIp;
  18. /** port seeda */
  19. int seedPort;
  20. /** port peera */
  21. int peerPort;
  22. Simulation *sim;
  23. public:
  24. P2PServer();
  25. P2PServer(string hostname, string ip, string mask);
  26. virtual ~P2PServer();
  27. /**
  28. * obsługuje przychodzące pakiety do serwera oraz zwraca do seeda
  29. * informacje o adresie IP i otwartym porcie peera
  30. */
  31. virtual void onRecv();
  32. /* mutuatory */
  33. const Simulation* getSim();
  34. void setSim(Simulation* sim);
  35. };
  36. #endif /* P2PSERVER_H_ */