X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2Fio%2Fasync%2Ftest%2FAsyncUDPSocketTest.cpp;h=2af6ffb6267c4172a389128aeb7f32b7ba7fca82;hp=b9f99af1f1aa70b05fc712f1d15325945e6aad57;hb=7f22ad99b5c4583d8f579911b8907c7758a4151e;hpb=61a1244ec0d11e8a612c4e2614c8cea32f4d87d4 diff --git a/folly/io/async/test/AsyncUDPSocketTest.cpp b/folly/io/async/test/AsyncUDPSocketTest.cpp index b9f99af1..2af6ffb6 100644 --- a/folly/io/async/test/AsyncUDPSocketTest.cpp +++ b/folly/io/async/test/AsyncUDPSocketTest.cpp @@ -41,16 +41,14 @@ class UDPAcceptor UDPAcceptor(EventBase* evb, int n): evb_(evb), n_(n) { } - void onListenStarted() noexcept { - } + void onListenStarted() noexcept override {} - void onListenStopped() noexcept { - } + void onListenStopped() noexcept override {} void onDataAvailable(std::shared_ptr socket, const folly::SocketAddress& client, std::unique_ptr data, - bool truncated) noexcept { + bool truncated) noexcept override { lastClient_ = client; lastMsg_ = data->moveToFbString().toStdString(); @@ -206,14 +204,14 @@ class UDPClient folly::IOBuf::copyBuffer(folly::to("PING ", n_))); } - void getReadBuffer(void** buf, size_t* len) noexcept { + void getReadBuffer(void** buf, size_t* len) noexcept override { *buf = buf_; *len = 1024; } void onDataAvailable(const folly::SocketAddress& client, size_t len, - bool truncated) noexcept { + bool truncated) noexcept override { VLOG(4) << "Read " << len << " bytes (trun:" << truncated << ") from " << client.describe() << " - " << std::string(buf_, len); VLOG(4) << n_ << " left"; @@ -223,18 +221,18 @@ class UDPClient sendPing(); } - void onReadError(const folly::AsyncSocketException& ex) noexcept { + void onReadError(const folly::AsyncSocketException& ex) noexcept override { VLOG(4) << ex.what(); // Start listening for next PONG socket_->resumeRead(this); } - void onReadClosed() noexcept { + void onReadClosed() noexcept override { CHECK(false) << "We unregister reads before closing"; } - void timeoutExpired() noexcept { + void timeoutExpired() noexcept override { VLOG(4) << "Timeout expired"; sendPing(); }