blob: 05dcd292f8e9d290cff192208dc163167886933f [file] [log] [blame]
Niels Möller44153152018-12-17 13:04:051/*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef RTC_BASE_SERVER_SOCKET_ADAPTERS_H_
12#define RTC_BASE_SERVER_SOCKET_ADAPTERS_H_
13
Steve Anton10542f22019-01-11 17:11:0014#include "rtc_base/socket_adapters.h"
Niels Möller44153152018-12-17 13:04:0515
16namespace rtc {
17
18// Interface for implementing proxy server sockets.
19class AsyncProxyServerSocket : public BufferedReadAdapter {
20 public:
Niels Möllerd0b88792021-08-12 08:32:3021 AsyncProxyServerSocket(Socket* socket, size_t buffer_size);
Niels Möller44153152018-12-17 13:04:0522 ~AsyncProxyServerSocket() override;
23 sigslot::signal2<AsyncProxyServerSocket*, const SocketAddress&>
24 SignalConnectRequest;
25 virtual void SendConnectResult(int err, const SocketAddress& addr) = 0;
26};
27
28// Implements a socket adapter that performs the server side of a
29// fake SSL handshake. Used when implementing a relay server that does "ssltcp".
30class AsyncSSLServerSocket : public BufferedReadAdapter {
31 public:
Niels Möllerd0b88792021-08-12 08:32:3032 explicit AsyncSSLServerSocket(Socket* socket);
Niels Möller44153152018-12-17 13:04:0533
Byoungchan Lee14af7622022-01-11 20:24:5834 AsyncSSLServerSocket(const AsyncSSLServerSocket&) = delete;
35 AsyncSSLServerSocket& operator=(const AsyncSSLServerSocket&) = delete;
36
Niels Möller44153152018-12-17 13:04:0537 protected:
38 void ProcessInput(char* data, size_t* len) override;
Niels Möller44153152018-12-17 13:04:0539};
40
Niels Möller44153152018-12-17 13:04:0541} // namespace rtc
42
43#endif // RTC_BASE_SERVER_SOCKET_ADAPTERS_H_