1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-08 09:42:06 +03:00

Remove throws from socket layer

Summary: More in the theme of returning Expected instead of throwing. For the folly case, we keep the try/catches in there and translate to Expected. For Libev, we convert directly to Expected.

Reviewed By: kvtsoy

Differential Revision: D73217128

fbshipit-source-id: d00a978f24e3b29a77a8ac99a19765ae49f64df8
This commit is contained in:
Matt Joras
2025-04-19 15:20:15 -07:00
committed by Facebook GitHub Bot
parent e196f31741
commit 089bf581a7
41 changed files with 2057 additions and 692 deletions

View File

@@ -75,6 +75,23 @@ class QuicTransportTest : public Test {
std::unique_ptr<MockAsyncUDPSocket> sock =
std::make_unique<NiceMock<MockAsyncUDPSocket>>(qEvb_);
socket_ = sock.get();
ON_CALL(*socket_, setAdditionalCmsgsFunc(_))
.WillByDefault(Return(folly::unit));
ON_CALL(*socket_, setTosOrTrafficClass(_))
.WillByDefault(Return(folly::unit));
ON_CALL(*socket_, close()).WillByDefault(Return(folly::unit));
ON_CALL(*socket_, getGSO()).WillByDefault(Return(0));
ON_CALL(*socket_, init(_)).WillByDefault(Return(folly::unit));
ON_CALL(*socket_, bind(_)).WillByDefault(Return(folly::unit));
ON_CALL(*socket_, connect(_)).WillByDefault(Return(folly::unit));
ON_CALL(*socket_, setRecvTos(_)).WillByDefault(Return(folly::unit));
ON_CALL(*socket_, setReuseAddr(_)).WillByDefault(Return(folly::unit));
ON_CALL(*socket_, setReusePort(_)).WillByDefault(Return(folly::unit));
ON_CALL(*socket_, setRcvBuf(_)).WillByDefault(Return(folly::unit));
ON_CALL(*socket_, setSndBuf(_)).WillByDefault(Return(folly::unit));
ON_CALL(*socket_, setErrMessageCallback(_))
.WillByDefault(Return(folly::unit));
ON_CALL(*socket_, applyOptions(_, _)).WillByDefault(Return(folly::unit));
transport_.reset(new TestQuicTransport(
qEvb_, std::move(sock), &connSetupCallback_, &connCallback_));
// Set the write handshake state to tell the client that the handshake has