iOS SDK API Reference

SKWConnection.h
Go to the documentation of this file.
1 // SKWConnection.h
3 // SkyWay SDK
5 #import <Foundation/Foundation.h>
6 #import "SKWCommon.h"
7 
12 @class SKWPeer;
13 
17 typedef NS_ENUM(NSUInteger, SKWSerializationEnum)
18 {
27 };
28 
52 typedef void (^SKWConnectionGetStatsCallback)(NSArray* __nullable stats);
53 
54 
62 @interface SKWConnection : NSObject
63 
67 @property (nonatomic, readonly) NSString* __nullable connectionId;
68 
69 #ifndef DOXYGEN_SKIP_THIS
70 @property (nonatomic, readonly) NSDictionary* __nullable payload SKYWAY_API_DEPRECATED;
72 #endif // !DOXYGEN_SKIP_THIS
73 
77 @property (nonatomic, readonly) NSString* __nullable metadata;
78 
82 @property (nonatomic, readonly) BOOL isOpen;
83 
87 @property (nonatomic, readonly) NSString* __nullable peer;
88 
92 @property (nonatomic, readonly) NSString* __nullable type;
93 
97 @property (nonatomic, readonly) NSString* __nullable label;
98 
102 @property (nonatomic, readonly) BOOL reliable;
103 
107 @property (nonatomic, readonly) SKWSerializationEnum serialization;
108 
112 @property (nonatomic, weak, readonly) SKWPeer* __nullable provider;
113 
114 #ifndef DOXYGEN_SKIP_THIS
115 @property (nonatomic, readonly) id __nullable peerConnection SKYWAY_API_DEPRECATED;
117 #endif // !DOXYGEN_SKIP_THIS
118 
134 - (void)getStats:(SKWConnectionGetStatsCallback __nullable)callback;
135 
136 #pragma mark - Objective-C dependent
137 
138 #ifndef DOXYGEN_SKIP_THIS
139 - (void)getPeerConnectionState:(BOOL)bOutputDebug callback:(void(^ __nullable)(NSArray* __nullable))callback SKYWAY_API_DEPRECATED;
146 #endif // !DOXYGEN_SKIP_THIS
147 
148 @end
SKWConnection::serialization
SKWSerializationEnum serialization
The serialization format of the data sent over the connection.
Definition: SKWConnection.h:107
SKW_SERIALIZATION_JSON
@ SKW_SERIALIZATION_JSON
JSON.
Definition: SKWConnection.h:24
SKWConnection::connectionId
NSString *__nullable connectionId
Connection ID.
Definition: SKWConnection.h:67
SKWPeer
A peer class.
Definition: SKWPeer.h:98
SKWConnection::type
NSString *__nullable type
For type of connection.
Definition: SKWConnection.h:92
SKWConnectionGetStatsCallback
void(^ SKWConnectionGetStatsCallback)(NSArray *__nullable stats)
Getting statistics Callback signature.
Definition: SKWConnection.h:52
SKW_SERIALIZATION_BINARY
@ SKW_SERIALIZATION_BINARY
Binary.
Definition: SKWConnection.h:20
SKWSerializationEnum
SKWSerializationEnum
Serialization type.
Definition: SKWConnection.h:17
SKW_SERIALIZATION_BINARY_UTF8
@ SKW_SERIALIZATION_BINARY_UTF8
Binary (UTF-8)
Definition: SKWConnection.h:22
SKWConnection::reliable
BOOL reliable
Whether the underlying data channels are reliable; defined when the connection was initiated.
Definition: SKWConnection.h:102
SKWConnection::peer
NSString *__nullable peer
The ID of the peer on the other end of this connection.
Definition: SKWConnection.h:87
SKWConnection::label
NSString *__nullable label
The optional label passed in or assigned by PeerJS when the connection was initiated.
Definition: SKWConnection.h:97
SKWConnection::provider
SKWPeer *__nullable provider
Provider PeerObjC object.
Definition: SKWConnection.h:112
SKWConnection
Base class of SKWDataConnection and SKWMediaConnection.
Definition: SKWConnection.h:62
SKWConnection::isOpen
BOOL isOpen
This is true if the connection is open and ready for read/write.
Definition: SKWConnection.h:82
SKWConnection::metadata
NSString *__nullable metadata
Any type of metadata associated with the connection, passed in by whoever initiated the connection.
Definition: SKWConnection.h:77
SKW_SERIALIZATION_NONE
@ SKW_SERIALIZATION_NONE
NONE.
Definition: SKWConnection.h:26