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