Newer
Older
/*
*
* Created on: Mar 1, 2021
* Author: astrisw
*/
#ifndef UDP_PROTOCOL_H_
#define UDP_PROTOCOL_H_
* Implementation of a UDP socket
* @member field fd_sock: socket file descriptor
* @member field sockaddr_in: struct of the client address.
*/
class UDPProtocol : public BaseProtocol{
protected:
int fd_sock; //file descriptor
struct sockaddr_in cliaddr;
struct sockaddr_in srvaddr;
public:
UDPProtocol(std::string hs, int prt);
int connectToClient();
int connectToServer();
int rcvPacketFromCli(PacketLib::BasePacket &pack);
int sendPacketToSrv(PacketLib::BasePacket &pack);