OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // avoid dereferencing a null pointer. | 49 // avoid dereferencing a null pointer. |
50 explicit AsyncSocketAdapter(AsyncSocket* socket); | 50 explicit AsyncSocketAdapter(AsyncSocket* socket); |
51 ~AsyncSocketAdapter() override; | 51 ~AsyncSocketAdapter() override; |
52 void Attach(AsyncSocket* socket); | 52 void Attach(AsyncSocket* socket); |
53 SocketAddress GetLocalAddress() const override; | 53 SocketAddress GetLocalAddress() const override; |
54 SocketAddress GetRemoteAddress() const override; | 54 SocketAddress GetRemoteAddress() const override; |
55 int Bind(const SocketAddress& addr) override; | 55 int Bind(const SocketAddress& addr) override; |
56 int Connect(const SocketAddress& addr) override; | 56 int Connect(const SocketAddress& addr) override; |
57 int Send(const void* pv, size_t cb) override; | 57 int Send(const void* pv, size_t cb) override; |
58 int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; | 58 int SendTo(const void* pv, size_t cb, const SocketAddress& addr) override; |
59 int Recv(void* pv, size_t cb) override; | 59 int Recv(void* pv, size_t cb, int64_t* timestamp) override; |
60 int RecvFrom(void* pv, size_t cb, SocketAddress* paddr) override; | 60 int RecvFrom(void* pv, |
| 61 size_t cb, |
| 62 SocketAddress* paddr, |
| 63 int64_t* timestamp) override; |
61 int Listen(int backlog) override; | 64 int Listen(int backlog) override; |
62 AsyncSocket* Accept(SocketAddress* paddr) override; | 65 AsyncSocket* Accept(SocketAddress* paddr) override; |
63 int Close() override; | 66 int Close() override; |
64 int GetError() const override; | 67 int GetError() const override; |
65 void SetError(int error) override; | 68 void SetError(int error) override; |
66 ConnState GetState() const override; | 69 ConnState GetState() const override; |
67 int EstimateMTU(uint16_t* mtu) override; | 70 int EstimateMTU(uint16_t* mtu) override; |
68 int GetOption(Option opt, int* value) override; | 71 int GetOption(Option opt, int* value) override; |
69 int SetOption(Option opt, int value) override; | 72 int SetOption(Option opt, int value) override; |
70 | 73 |
71 protected: | 74 protected: |
72 virtual void OnConnectEvent(AsyncSocket* socket); | 75 virtual void OnConnectEvent(AsyncSocket* socket); |
73 virtual void OnReadEvent(AsyncSocket* socket); | 76 virtual void OnReadEvent(AsyncSocket* socket); |
74 virtual void OnWriteEvent(AsyncSocket* socket); | 77 virtual void OnWriteEvent(AsyncSocket* socket); |
75 virtual void OnCloseEvent(AsyncSocket* socket, int err); | 78 virtual void OnCloseEvent(AsyncSocket* socket, int err); |
76 | 79 |
77 AsyncSocket* socket_; | 80 AsyncSocket* socket_; |
78 }; | 81 }; |
79 | 82 |
80 } // namespace rtc | 83 } // namespace rtc |
81 | 84 |
82 #endif // WEBRTC_BASE_ASYNCSOCKET_H_ | 85 #endif // WEBRTC_BASE_ASYNCSOCKET_H_ |
OLD | NEW |