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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 virtual SocketAddress GetLocalAddress() const = 0; | 144 virtual SocketAddress GetLocalAddress() const = 0; |
145 | 145 |
146 // Returns the address to which the socket is connected. If the socket is | 146 // Returns the address to which the socket is connected. If the socket is |
147 // not connected, then the any-address is returned. | 147 // not connected, then the any-address is returned. |
148 virtual SocketAddress GetRemoteAddress() const = 0; | 148 virtual SocketAddress GetRemoteAddress() const = 0; |
149 | 149 |
150 virtual int Bind(const SocketAddress& addr) = 0; | 150 virtual int Bind(const SocketAddress& addr) = 0; |
151 virtual int Connect(const SocketAddress& addr) = 0; | 151 virtual int Connect(const SocketAddress& addr) = 0; |
152 virtual int Send(const void *pv, size_t cb) = 0; | 152 virtual int Send(const void *pv, size_t cb) = 0; |
153 virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr) = 0; | 153 virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr) = 0; |
| 154 // |timestamp| is in units of microseconds. |
154 virtual int Recv(void* pv, size_t cb, int64_t* timestamp) = 0; | 155 virtual int Recv(void* pv, size_t cb, int64_t* timestamp) = 0; |
155 virtual int RecvFrom(void* pv, | 156 virtual int RecvFrom(void* pv, |
156 size_t cb, | 157 size_t cb, |
157 SocketAddress* paddr, | 158 SocketAddress* paddr, |
158 int64_t* timestamp) = 0; | 159 int64_t* timestamp) = 0; |
159 virtual int Listen(int backlog) = 0; | 160 virtual int Listen(int backlog) = 0; |
160 virtual Socket *Accept(SocketAddress *paddr) = 0; | 161 virtual Socket *Accept(SocketAddress *paddr) = 0; |
161 virtual int Close() = 0; | 162 virtual int Close() = 0; |
162 virtual int GetError() const = 0; | 163 virtual int GetError() const = 0; |
163 virtual void SetError(int error) = 0; | 164 virtual void SetError(int error) = 0; |
(...skipping 28 matching lines...) Expand all Loading... |
192 protected: | 193 protected: |
193 Socket() {} | 194 Socket() {} |
194 | 195 |
195 private: | 196 private: |
196 RTC_DISALLOW_COPY_AND_ASSIGN(Socket); | 197 RTC_DISALLOW_COPY_AND_ASSIGN(Socket); |
197 }; | 198 }; |
198 | 199 |
199 } // namespace rtc | 200 } // namespace rtc |
200 | 201 |
201 #endif // WEBRTC_BASE_SOCKET_H__ | 202 #endif // WEBRTC_BASE_SOCKET_H__ |
OLD | NEW |