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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 virtual void SetError(int error) = 0; | 164 virtual void SetError(int error) = 0; |
165 inline bool IsBlocking() const { return IsBlockingError(GetError()); } | 165 inline bool IsBlocking() const { return IsBlockingError(GetError()); } |
166 | 166 |
167 enum ConnState { | 167 enum ConnState { |
168 CS_CLOSED, | 168 CS_CLOSED, |
169 CS_CONNECTING, | 169 CS_CONNECTING, |
170 CS_CONNECTED | 170 CS_CONNECTED |
171 }; | 171 }; |
172 virtual ConnState GetState() const = 0; | 172 virtual ConnState GetState() const = 0; |
173 | 173 |
174 // Fills in the given uint16_t with the current estimate of the MTU along the | |
175 // path to the address to which this socket is connected. NOTE: This method | |
176 // can block for up to 10 seconds on Windows. | |
177 virtual int EstimateMTU(uint16_t* mtu) = 0; | |
178 | |
179 enum Option { | 174 enum Option { |
180 OPT_DONTFRAGMENT, | 175 OPT_DONTFRAGMENT, |
181 OPT_RCVBUF, // receive buffer size | 176 OPT_RCVBUF, // receive buffer size |
182 OPT_SNDBUF, // send buffer size | 177 OPT_SNDBUF, // send buffer size |
183 OPT_NODELAY, // whether Nagle algorithm is enabled | 178 OPT_NODELAY, // whether Nagle algorithm is enabled |
184 OPT_IPV6_V6ONLY, // Whether the socket is IPv6 only. | 179 OPT_IPV6_V6ONLY, // Whether the socket is IPv6 only. |
185 OPT_DSCP, // DSCP code | 180 OPT_DSCP, // DSCP code |
186 OPT_RTP_SENDTIME_EXTN_ID, // This is a non-traditional socket option param. | 181 OPT_RTP_SENDTIME_EXTN_ID, // This is a non-traditional socket option param. |
187 // This is specific to libjingle and will be used | 182 // This is specific to libjingle and will be used |
188 // if SendTime option is needed at socket level. | 183 // if SendTime option is needed at socket level. |
189 }; | 184 }; |
190 virtual int GetOption(Option opt, int* value) = 0; | 185 virtual int GetOption(Option opt, int* value) = 0; |
191 virtual int SetOption(Option opt, int value) = 0; | 186 virtual int SetOption(Option opt, int value) = 0; |
192 | 187 |
193 protected: | 188 protected: |
194 Socket() {} | 189 Socket() {} |
195 | 190 |
196 private: | 191 private: |
197 RTC_DISALLOW_COPY_AND_ASSIGN(Socket); | 192 RTC_DISALLOW_COPY_AND_ASSIGN(Socket); |
198 }; | 193 }; |
199 | 194 |
200 } // namespace rtc | 195 } // namespace rtc |
201 | 196 |
202 #endif // WEBRTC_BASE_SOCKET_H__ | 197 #endif // WEBRTC_BASE_SOCKET_H__ |
OLD | NEW |