Files
sk-nat/Peer.h
2017-01-17 15:31:00 +01:00

38 lines
584 B
C++

/*
* Peer.h
*
* Created on: 17.01.2017
* Author: piotrek
*/
#ifndef PEER_H_
#define PEER_H_
#include "common.h"
#include "Node.h"
class Peer : public Node
{
bool sender;
int srcPort;
string remoteIp;
int remotePort;
int partId;
public:
Peer();
Peer(string hostname, string ip, string mask, string gatewayIp);
virtual ~Peer() {};
virtual void onRecv();
void connectToServer(string serverIp, int serverPort);
bool isSender() const;
void setSender(bool sender);
protected:
void sendData();
void sendAck(string dstIp, int dstPort);
};
#endif /* PEER_H_ */