OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 19 matching lines...) Expand all Loading... | |
30 #include "webrtc/media/base/mediachannel.h" | 30 #include "webrtc/media/base/mediachannel.h" |
31 #include "webrtc/media/base/mediaengine.h" | 31 #include "webrtc/media/base/mediaengine.h" |
32 | 32 |
33 // Defined by "usrsctplib/usrsctp.h" | 33 // Defined by "usrsctplib/usrsctp.h" |
34 struct sockaddr_conn; | 34 struct sockaddr_conn; |
35 struct sctp_assoc_change; | 35 struct sctp_assoc_change; |
36 struct sctp_stream_reset_event; | 36 struct sctp_stream_reset_event; |
37 // Defined by <sys/socket.h> | 37 // Defined by <sys/socket.h> |
38 struct socket; | 38 struct socket; |
39 namespace cricket { | 39 namespace cricket { |
40 // The highest stream ID (Sid) that SCTP allows, and the number of streams we | 40 // The number of outgoing streams that we'll negotiate. Since stream IDs (SIDs) |
41 // tell SCTP we're going to use. | 41 // are 0-based, the highest usable SID is 1023. |
42 const uint32_t kMaxSctpSid = 1023; | 42 // |
43 // It's recommended to use the maximum of 65535 in: | |
44 // https://tools.ietf.org/html/draft-ietf-rtcweb-data-channel-13#section-6.2 | |
45 // However, we use 1024 in order to save memory. usrsctp allocates 104 bytes | |
46 // for each pair of incoming/outgoing streams (on a 64-bit system), so 65535 | |
47 // streams would waste ~6MB. | |
48 const uint16_t kMaxSctpStreams = 1024; | |
pthatcher1
2016/08/22 23:09:30
Why not have *both* kMaxSctpStreams and kMaxSctpSi
Taylor Brandstetter
2016/08/23 00:53:14
Ok. I thought "max streams" made it more clear tha
| |
43 | 49 |
44 // This is the default SCTP port to use. It is passed along the wire and the | 50 // This is the default SCTP port to use. It is passed along the wire and the |
45 // connectee and connector must be using the same port. It is not related to the | 51 // connectee and connector must be using the same port. It is not related to the |
46 // ports at the IP level. (Corresponds to: sockaddr_conn.sconn_port in | 52 // ports at the IP level. (Corresponds to: sockaddr_conn.sconn_port in |
47 // usrsctp.h) | 53 // usrsctp.h) |
48 const int kSctpDefaultPort = 5000; | 54 const int kSctpDefaultPort = 5000; |
49 | 55 |
50 class SctpDataMediaChannel; | 56 class SctpDataMediaChannel; |
51 | 57 |
52 // A DataEngine that interacts with usrsctp. | 58 // A DataEngine that interacts with usrsctp. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 StreamSet queued_reset_streams_; | 235 StreamSet queued_reset_streams_; |
230 StreamSet sent_reset_streams_; | 236 StreamSet sent_reset_streams_; |
231 | 237 |
232 // A static human-readable name for debugging messages. | 238 // A static human-readable name for debugging messages. |
233 const char* debug_name_; | 239 const char* debug_name_; |
234 }; | 240 }; |
235 | 241 |
236 } // namespace cricket | 242 } // namespace cricket |
237 | 243 |
238 #endif // WEBRTC_MEDIA_SCTP_SCTPDATAENGINE_H_ | 244 #endif // WEBRTC_MEDIA_SCTP_SCTPDATAENGINE_H_ |
OLD | NEW |