mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 06:21:48 +03:00
Migrate from TAsyncSocket
Summary: [Eden] Migrate from `TAsyncSocket` to `folly::AsyncSocket`. Reviewed By: wez Differential Revision: D20714988 fbshipit-source-id: 86c1dc11604ab0178a69d8d39a0c4c4490c65182
This commit is contained in:
parent
7af4ada776
commit
a46d754df6
@ -10,9 +10,9 @@
|
||||
#include <folly/File.h>
|
||||
#include <folly/container/Array.h>
|
||||
#include <folly/init/Init.h>
|
||||
#include <folly/io/async/AsyncSocket.h>
|
||||
#include <folly/net/NetworkSocket.h>
|
||||
#include <folly/synchronization/test/Barrier.h>
|
||||
#include <thrift/lib/cpp/async/TAsyncSocket.h>
|
||||
#include <thrift/lib/cpp2/async/HeaderClientChannel.h>
|
||||
#include <iostream>
|
||||
#include <numeric>
|
||||
@ -90,7 +90,7 @@ int main(int argc, char** argv) {
|
||||
return;
|
||||
}
|
||||
folly::EventBase eventBase;
|
||||
auto socket = apache::thrift::async::TAsyncSocket::newSocket(
|
||||
auto socket = folly::AsyncSocket::newSocket(
|
||||
&eventBase, folly::NetworkSocket::fromFd(sock_fd));
|
||||
auto channel = folly::to_shared_ptr(
|
||||
apache::thrift::HeaderClientChannel::newChannel(socket));
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include <folly/SocketAddress.h>
|
||||
#include <folly/futures/Future.h>
|
||||
#include <folly/io/async/AsyncSignalHandler.h>
|
||||
#include <folly/io/async/AsyncSocket.h>
|
||||
#include <folly/logging/xlog.h>
|
||||
#include <thrift/lib/cpp/async/TAsyncSocket.h>
|
||||
#include <thrift/lib/cpp2/async/HeaderClientChannel.h>
|
||||
|
||||
#include "eden/fs/eden-config.h"
|
||||
@ -25,7 +25,7 @@
|
||||
#endif
|
||||
|
||||
using apache::thrift::HeaderClientChannel;
|
||||
using apache::thrift::async::TAsyncSocket;
|
||||
using folly::AsyncSocket;
|
||||
using folly::Future;
|
||||
using folly::SocketAddress;
|
||||
using folly::Try;
|
||||
@ -155,7 +155,7 @@ Future<Unit> EdenMonitor::getEdenInstance() {
|
||||
std::shared_ptr<EdenServiceAsyncClient> EdenMonitor::createEdenThriftClient() {
|
||||
auto socketPath = edenDir_ + PathComponentPiece("socket");
|
||||
uint32_t connectTimeoutMS = 500;
|
||||
auto socket = TAsyncSocket::newSocket(
|
||||
auto socket = AsyncSocket::newSocket(
|
||||
&eventBase_,
|
||||
SocketAddress::makeFromPath(socketPath.value()),
|
||||
connectTimeoutMS);
|
||||
|
Loading…
Reference in New Issue
Block a user