/* * * Created on: Mar 1, 2021 * Author: astrisw */ #ifndef UDP_PROTOCOL_H_ #define UDP_PROTOCOL_H_ #include /* * class UDPProtocol * Implementation of a UDP socket * @member field fd_sock: socket file descriptor * @member field sockaddr_in: struct of the client address. */ namespace inaf::oasbo::ConnectionProtocols{ 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); }; } #endif /* UDP_PROTOCOL_H_ */