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();
template<typename Value, template<typename> typename Container>
int sendPacketToSrv(PacketLib::BasePacket<Container,Value> &);
template<typename Value, template<typename> typename Container>
int rcvPacketFromCli(PacketLib::BasePacket<Container,Value> &);