Beispiel #1
0
bool AsyncMcServerWorker::addSecureClientSocket(
    int fd,
    const std::shared_ptr<folly::SSLContext>& context,
    void* userCtxt) {
  folly::AsyncSSLSocket::UniquePtr sslSocket(
      new folly::AsyncSSLSocket(context, &eventBase_, fd, /* server = */ true));
  return addClientSocket(std::move(sslSocket), userCtxt);
}
void AsyncMcServerWorker::addSecureClientSocket(
    int fd,
    const std::shared_ptr<folly::SSLContext>& context,
    void* userCtxt) {
  folly::AsyncSSLSocket::UniquePtr sslSocket(
      new folly::AsyncSSLSocket(
          context, &eventBase_, fd, /* server = */ true));
  sslSocket->sslAccept(&simpleHandshakeCallback, /* timeout = */ 0);
  addClientSocket(std::move(sslSocket), userCtxt);
}
void AsyncMcServerWorker::addClientSocket(int fd, void* userCtxt) {
  auto socket = folly::AsyncSocket::UniquePtr(
      new folly::AsyncSocket(&eventBase_, fd));
  addClientSocket(std::move(socket), userCtxt);
}
void AsyncMcServerWorker::addClientSocket(int fd, void* userCtxt) {
  auto socket = apache::thrift::async::TAsyncSocket::UniquePtr(
      new apache::thrift::async::TAsyncSocket(&eventBase_, fd));
  addClientSocket(std::move(socket), userCtxt);
}