Updates based on feedback on #1222 and more#1280
Conversation
…t UDP f.ex. also can use this
…terator to end of span, not last Stat-element (same as end)
…ing and ICMP_packet now has a payload of type string instead of Span
… information, not source
…ror_report signature. Added timer that flushes all sendto_handler callbacks that have not resulted in an error (ICMP_error f.ex.)
…on. Constructor taking an icmp4 Packet (cleaner)
…tor and other small updates.
…an ICMP packet) that works on both Mac and Ubuntu (the previous one doesn't work on Ubuntu)
… ping with DNS resolution (in progress). Cleanup
…ed ping with DNS resolution (in progress)
…ing slicing) and no longer const when passed between functions. DNS integration test updated to test this (dynamic cast from Error to ICMP_error)
…dress ending with .255 does not have to be a brodcast address). Updated test for whether IP address is multicast or broadcast in IP4 and UDP. IP4 unit test update: IP packet with unknown protocol gets dropped
…to Socket (moved to namespace net) and DNS resolution (callback with Error)
…callback and updates in that regard elsewhere in the OS. UDP: Socket is now key into error_callbacks_ map. Socket: Added hash function so that this can be a key into a map
|
|
||
| template <typename IPv> | ||
| using resolve_func = delegate<void(typename IPv::addr)>; | ||
| using resolve_func = delegate<void(typename IPv::addr, Error&)>; |
There was a problem hiding this comment.
Question: Are there use cases where Error is modified inside the callback? If not, maybe pass it as const reference?
There was a problem hiding this comment.
No seems like Error& can be const here =)
| /** Error entries are just error callbacks and timestamps */ | ||
| class Error_entry { | ||
| public: | ||
| Error_entry(UDP::error_handler cb) noexcept |
There was a problem hiding this comment.
By moving the implementation of the constructor to the cpp you can avoid including <rtc> in the header (reducing the scope).
There was a problem hiding this comment.
private attribute RTC::timestamp_t, but could consider int64_t
| }; //< class Error_entry | ||
|
|
||
| /** The error callbacks that the user has sent in via the UDPSockets' sendto and bcast methods */ | ||
| std::unordered_map<Socket, Error_entry, Socket::pair_hash> error_callbacks_; |
There was a problem hiding this comment.
A implementation of std::hash<Socket> would make it possible to drop the third template arg Socket::pair_hash (this function can be called inside the std::hash`). See http://en.cppreference.com/w/cpp/utility/hash
| : source_{}, destination_{} | ||
| {} | ||
|
|
||
| Quadruple(const Socket::Address src_address, const Socket::port_t src_port, |
There was a problem hiding this comment.
Maybe add additional constructor Quadruple(Socket, Socket).
dns_test: Added setup.sh which sets up env for dns test
|
jenkins test please |
|
This is the error I was seeing yesterday as well @AnnikaH where it seems like you were not expecting the 10.0.0.1 dns server to actually give a valid response. (but it seems like it does)
|
… so presumed error case is removed (not the case locally)
and more