1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-27 03:41:14 +03:00
Files
mvfst/quic/common/QuicAsyncUDPSocketWrapper.cpp
Konstantin Tsoy c8daa9bf01 Abstract away socket fd getter/setter
Summary: This is needed for the new socket abstraction implementation later.

Reviewed By: jbeshay, lnicco

Differential Revision: D46669712

fbshipit-source-id: 5adde6679386689e7f63992ed769ff4a777f59e3
2023-07-12 17:26:15 -07:00

29 lines
613 B
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <quic/common/QuicAsyncUDPSocketWrapper.h>
namespace quic {
#ifdef MVFST_USE_LIBEV
int getSocketFd(const QuicAsyncUDPSocketType& /* s */) {
return -1;
}
NetworkFdType toNetworkFdType(int fd) {
return fd;
}
#else
int getSocketFd(const QuicAsyncUDPSocketType& s) {
return s.getNetworkSocket().toFd();
}
NetworkFdType toNetworkFdType(int fd) {
return folly::NetworkSocket(fd);
}
#endif
} // namespace quic