You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Copyright 2015 The WebRTC project authors. All Rights Reserved.
  3. *
  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
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #import "RTCDataChannelConfiguration+Private.h"
  11. #import "helpers/NSString+StdString.h"
  12. @implementation RTCDataChannelConfiguration
  13. @synthesize nativeDataChannelInit = _nativeDataChannelInit;
  14. - (BOOL)isOrdered {
  15. return _nativeDataChannelInit.ordered;
  16. }
  17. - (void)setIsOrdered:(BOOL)isOrdered {
  18. _nativeDataChannelInit.ordered = isOrdered;
  19. }
  20. - (NSInteger)maxRetransmitTimeMs {
  21. return self.maxPacketLifeTime;
  22. }
  23. - (void)setMaxRetransmitTimeMs:(NSInteger)maxRetransmitTimeMs {
  24. self.maxPacketLifeTime = maxRetransmitTimeMs;
  25. }
  26. - (int)maxPacketLifeTime {
  27. return *_nativeDataChannelInit.maxRetransmitTime;
  28. }
  29. - (void)setMaxPacketLifeTime:(int)maxPacketLifeTime {
  30. _nativeDataChannelInit.maxRetransmitTime = maxPacketLifeTime;
  31. }
  32. - (int)maxRetransmits {
  33. if (_nativeDataChannelInit.maxRetransmits) {
  34. return *_nativeDataChannelInit.maxRetransmits;
  35. } else {
  36. return -1;
  37. }
  38. }
  39. - (void)setMaxRetransmits:(int)maxRetransmits {
  40. _nativeDataChannelInit.maxRetransmits = maxRetransmits;
  41. }
  42. - (NSString *)protocol {
  43. return [NSString stringForStdString:_nativeDataChannelInit.protocol];
  44. }
  45. - (void)setProtocol:(NSString *)protocol {
  46. _nativeDataChannelInit.protocol = [NSString stdStringForString:protocol];
  47. }
  48. - (BOOL)isNegotiated {
  49. return _nativeDataChannelInit.negotiated;
  50. }
  51. - (void)setIsNegotiated:(BOOL)isNegotiated {
  52. _nativeDataChannelInit.negotiated = isNegotiated;
  53. }
  54. - (int)streamId {
  55. return self.channelId;
  56. }
  57. - (void)setStreamId:(int)streamId {
  58. self.channelId = streamId;
  59. }
  60. - (int)channelId {
  61. return _nativeDataChannelInit.id;
  62. }
  63. - (void)setChannelId:(int)channelId {
  64. _nativeDataChannelInit.id = channelId;
  65. }
  66. @end