| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 #define SOCKET_ERROR (-1) | 117 #define SOCKET_ERROR (-1) |
| 118 #define closesocket(s) close(s) | 118 #define closesocket(s) close(s) |
| 119 #endif // WEBRTC_POSIX | 119 #endif // WEBRTC_POSIX |
| 120 | 120 |
| 121 namespace rtc { | 121 namespace rtc { |
| 122 | 122 |
| 123 inline bool IsBlockingError(int e) { | 123 inline bool IsBlockingError(int e) { |
| 124 return (e == EWOULDBLOCK) || (e == EAGAIN) || (e == EINPROGRESS); | 124 return (e == EWOULDBLOCK) || (e == EAGAIN) || (e == EINPROGRESS); |
| 125 } | 125 } |
| 126 | 126 |
| 127 struct SentPacket { |
| 128 SentPacket() : packet_id(-1), send_time_ms(-1) {} |
| 129 SentPacket(int packet_id, int64_t send_time_ms) |
| 130 : packet_id(packet_id), send_time_ms(send_time_ms) {} |
| 131 |
| 132 int packet_id; |
| 133 int64_t send_time_ms; |
| 134 }; |
| 135 |
| 127 // General interface for the socket implementations of various networks. The | 136 // General interface for the socket implementations of various networks. The |
| 128 // methods match those of normal UNIX sockets very closely. | 137 // methods match those of normal UNIX sockets very closely. |
| 129 class Socket { | 138 class Socket { |
| 130 public: | 139 public: |
| 131 virtual ~Socket() {} | 140 virtual ~Socket() {} |
| 132 | 141 |
| 133 // Returns the address to which the socket is bound. If the socket is not | 142 // Returns the address to which the socket is bound. If the socket is not |
| 134 // bound, then the any-address is returned. | 143 // bound, then the any-address is returned. |
| 135 virtual SocketAddress GetLocalAddress() const = 0; | 144 virtual SocketAddress GetLocalAddress() const = 0; |
| 136 | 145 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 protected: | 189 protected: |
| 181 Socket() {} | 190 Socket() {} |
| 182 | 191 |
| 183 private: | 192 private: |
| 184 RTC_DISALLOW_COPY_AND_ASSIGN(Socket); | 193 RTC_DISALLOW_COPY_AND_ASSIGN(Socket); |
| 185 }; | 194 }; |
| 186 | 195 |
| 187 } // namespace rtc | 196 } // namespace rtc |
| 188 | 197 |
| 189 #endif // WEBRTC_BASE_SOCKET_H__ | 198 #endif // WEBRTC_BASE_SOCKET_H__ |
| OLD | NEW |