sources/network/udpsocket.h

changeset 191
2e6cbacafdc7
parent 190
90bf9049e5eb
equal deleted inserted replaced
190:90bf9049e5eb 191:2e6cbacafdc7
41 class UDPSocket; 41 class UDPSocket;
42 } 42 }
43 43
44 struct net::Datagram 44 struct net::Datagram
45 { 45 {
46 ByteArray message; 46 std::vector<unsigned char> message;
47 net::ip_address address; 47 net::ip_address address;
48 }; 48 };
49 49
50 // ------------------------------------------------------------------------------------------------- 50 // -------------------------------------------------------------------------------------------------
51 // 51 //
54 public: 54 public:
55 UDPSocket(); 55 UDPSocket();
56 virtual ~UDPSocket(); 56 virtual ~UDPSocket();
57 [[nodiscard]] bool bind(port_t port, std::ostream &errors); 57 [[nodiscard]] bool bind(port_t port, std::ostream &errors);
58 [[nodiscard]] bool read(Datagram& datagram, std::ostream& errors); 58 [[nodiscard]] bool read(Datagram& datagram, std::ostream& errors);
59 [[nodiscard]] bool send(const ip_address& address, const ByteArray& data, std::ostream &errors); 59 [[nodiscard]] bool send(const ip_address& address, const std::vector<unsigned char>& data, std::ostream &errors);
60 [[nodiscard]] bool set_blocking(bool a, std::ostream &errors); 60 [[nodiscard]] bool set_blocking(bool a, std::ostream &errors);
61 const int file_descriptor; 61 const int file_descriptor;
62 }; 62 };
63 63
64 END_ZFC_NAMESPACE 64 END_ZFC_NAMESPACE

mercurial