diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-08-09 18:15:16 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-08-09 18:15:16 +0200 |
commit | ce9792fc49e4722a927b790c08ad83bdad673e7e (patch) | |
tree | 25d6d097dfeea29bd997873c18fdebce9172763c /src/UdpSocket.h | |
parent | f9bdf5bec2f3778c4fef99da698a8a7a6f182fe0 (diff) | |
download | dabmux-ce9792fc49e4722a927b790c08ad83bdad673e7e.tar.gz dabmux-ce9792fc49e4722a927b790c08ad83bdad673e7e.tar.bz2 dabmux-ce9792fc49e4722a927b790c08ad83bdad673e7e.zip |
EDI: Do not use misbehaving UdpPacket
Diffstat (limited to 'src/UdpSocket.h')
-rw-r--r-- | src/UdpSocket.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/UdpSocket.h b/src/UdpSocket.h index 109732f..e23401c 100644 --- a/src/UdpSocket.h +++ b/src/UdpSocket.h @@ -47,6 +47,8 @@ #include <stdlib.h> #include <iostream> +#include <vector> + class UdpPacket; @@ -71,6 +73,8 @@ class UdpSocket { int create(int port = 0, char *name = NULL); int send(UdpPacket &packet); + int send(const std::vector<uint8_t> data); + int send(std::vector<uint8_t> data, InetAddress destination); int receive(UdpPacket &packet); int joinGroup(char* groupname); /** @@ -101,8 +105,10 @@ class UdpSocket { class UdpPacket { public: UdpPacket(unsigned int initSize = 1024); - // Not implemented - UdpPacket(const UdpPacket& packet); + UdpPacket(const UdpPacket& packet) = delete; + const UdpPacket& operator=(const UdpPacket&) = delete; + UdpPacket(const UdpPacket&& packet) = delete; + const UdpPacket& operator=(const UdpPacket&&) = delete; ~UdpPacket(); char *getData(); @@ -114,8 +120,6 @@ class UdpPacket { void setOffset(unsigned long val); void setSize(unsigned newSize); InetAddress &getAddress(); - // Not implemented - const UdpPacket& operator=(const UdpPacket&); private: char *dataBuf; @@ -124,3 +128,4 @@ class UdpPacket { }; #endif // _UDPSOCKET + |