mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2024-10-06 09:12:08 +08:00
Use method argument instead of property to provide packet flow
This commit is contained in:
parent
d16a8ddade
commit
b357c50067
@ -96,11 +96,6 @@ NS_SWIFT_NAME(openVPNAdapter(_:handleEvent:message:));
|
||||
*/
|
||||
@property (nonatomic, class, readonly) NSString *platform;
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
@property (nonatomic, weak) id<OpenVPNAdapterPacketFlow> packetFlow;
|
||||
|
||||
/**
|
||||
The object that acts as the delegate of the adapter.
|
||||
*/
|
||||
@ -154,8 +149,10 @@ NS_SWIFT_NAME(apply(configuration:));
|
||||
|
||||
/**
|
||||
Starts the tunnel.
|
||||
|
||||
@param packetFlow The object implementing OpenVPNAdapterPacketFlow protocol.
|
||||
*/
|
||||
- (void)connect;
|
||||
- (void)connectUsingPacketFlow:(id<OpenVPNAdapterPacketFlow>)packetFlow NS_SWIFT_NAME(connect(using:));
|
||||
|
||||
/**
|
||||
Pauses the tunnel.
|
||||
|
@ -86,8 +86,8 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)connect {
|
||||
NSAssert(self.packetFlow != nil, @"packetFlow property shouldn't be nil, set it before trying to establish connection.");
|
||||
- (void)connectUsingPacketFlow:(id<OpenVPNAdapterPacketFlow>)packetFlow {
|
||||
self.packetFlowBridge.packetFlow = packetFlow;
|
||||
|
||||
dispatch_queue_attr_t attributes = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_UTILITY, 0);
|
||||
dispatch_queue_t connectQueue = dispatch_queue_create("me.ss-abramchuk.openvpn-adapter.connection.", attributes);
|
||||
@ -168,14 +168,6 @@
|
||||
return _networkSettingsBuilder;
|
||||
}
|
||||
|
||||
- (id<OpenVPNAdapterPacketFlow>)packetFlow {
|
||||
return self.packetFlowBridge.packetFlow;
|
||||
}
|
||||
|
||||
- (void)setPacketFlow:(id<OpenVPNAdapterPacketFlow>)packetFlow {
|
||||
self.packetFlowBridge.packetFlow = packetFlow;
|
||||
}
|
||||
|
||||
#pragma mark - OpenVPNClientDelegate
|
||||
|
||||
- (BOOL)setRemoteAddress:(NSString *)address {
|
||||
|
Loading…
Reference in New Issue
Block a user