Skip to content

Commit

Permalink
Support synchronous proxies and error blocks
Browse files Browse the repository at this point in the history
Both server and client connections now connect using initWithServiceName:
  • Loading branch information
LeoNatan committed Oct 17, 2019
1 parent e831645 commit bd014ec
Show file tree
Hide file tree
Showing 19 changed files with 370 additions and 150 deletions.
22 changes: 14 additions & 8 deletions DetoxIPC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,37 @@
objects = {

/* Begin PBXBuildFile section */
393A512C235729B400DFCEF5 /* DTXIPCBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 393A512B2357295F00DFCEF5 /* DTXIPCBase.h */; settings = {ATTRIBUTES = (Public, ); }; };
397D3E41233A2A4000E69D28 /* DTXIPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 397D3E3F233A2A4000E69D28 /* DTXIPCConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
397D3E42233A2A4000E69D28 /* DTXIPCConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 397D3E40233A2A4000E69D28 /* DTXIPCConnection.m */; };
39B833DA233A7D7000DBC1D2 /* DetoxIPC.pch in Headers */ = {isa = PBXBuildFile; fileRef = 39B833D9233A7D7000DBC1D2 /* DetoxIPC.pch */; };
39B833DE233A920200DBC1D2 /* _DTXIPCDistantObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 39B833DC233A920200DBC1D2 /* _DTXIPCDistantObject.h */; };
39B833DF233A920200DBC1D2 /* _DTXIPCDistantObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 39B833DD233A920200DBC1D2 /* _DTXIPCDistantObject.m */; };
39BEEFE7233B87CF001C84C3 /* _DTXIPCRemoteBlockRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BEEFE5233B87CF001C84C3 /* _DTXIPCRemoteBlockRegistry.h */; };
39BEEFE8233B87CF001C84C3 /* _DTXIPCRemoteBlockRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 39BEEFE6233B87CF001C84C3 /* _DTXIPCRemoteBlockRegistry.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
39BEEFEC233B994E001C84C3 /* _DTXIPCLocalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BEEFEA233B994E001C84C3 /* _DTXIPCLocalObject.h */; };
39BEEFED233B994E001C84C3 /* _DTXIPCLocalObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 39BEEFEB233B994E001C84C3 /* _DTXIPCLocalObject.m */; };
39BEEFEC233B994E001C84C3 /* _DTXIPCExportedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BEEFEA233B994E001C84C3 /* _DTXIPCExportedObject.h */; };
39BEEFED233B994E001C84C3 /* _DTXIPCExportedObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 39BEEFEB233B994E001C84C3 /* _DTXIPCExportedObject.m */; };
39BEEFF0233BA85C001C84C3 /* NSInvocation+DTXRemoteSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BEEFEE233BA85C001C84C3 /* NSInvocation+DTXRemoteSerialization.h */; };
39BEEFF1233BA85C001C84C3 /* NSInvocation+DTXRemoteSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 39BEEFEF233BA85C001C84C3 /* NSInvocation+DTXRemoteSerialization.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
393A512B2357295F00DFCEF5 /* DTXIPCBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTXIPCBase.h; sourceTree = "<group>"; };
3971742D233A38EE00FFE816 /* NSConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSConnection.h; sourceTree = "<group>"; };
397D3E2A233A293D00E69D28 /* DetoxIPC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DetoxIPC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
397D3E2E233A293D00E69D28 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
397D3E3F233A2A4000E69D28 /* DTXIPCConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTXIPCConnection.h; sourceTree = "<group>"; };
397D3E40233A2A4000E69D28 /* DTXIPCConnection.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DTXIPCConnection.m; sourceTree = "<group>"; };
39A5CF072358B1A100B905F8 /* NSPortNameServer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSPortNameServer.h; sourceTree = "<group>"; };
39B833D9233A7D7000DBC1D2 /* DetoxIPC.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetoxIPC.pch; sourceTree = "<group>"; };
39B833DB233A898400DBC1D2 /* ObjCRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjCRuntime.h; sourceTree = "<group>"; };
39B833DC233A920200DBC1D2 /* _DTXIPCDistantObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _DTXIPCDistantObject.h; sourceTree = "<group>"; };
39B833DD233A920200DBC1D2 /* _DTXIPCDistantObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = _DTXIPCDistantObject.m; sourceTree = "<group>"; };
39BEEFE5233B87CF001C84C3 /* _DTXIPCRemoteBlockRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _DTXIPCRemoteBlockRegistry.h; sourceTree = "<group>"; };
39BEEFE6233B87CF001C84C3 /* _DTXIPCRemoteBlockRegistry.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = _DTXIPCRemoteBlockRegistry.m; sourceTree = "<group>"; };
39BEEFE9233B895F001C84C3 /* DTXIPCConnection-Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DTXIPCConnection-Private.h"; sourceTree = "<group>"; };
39BEEFEA233B994E001C84C3 /* _DTXIPCLocalObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _DTXIPCLocalObject.h; sourceTree = "<group>"; };
39BEEFEB233B994E001C84C3 /* _DTXIPCLocalObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = _DTXIPCLocalObject.m; sourceTree = "<group>"; };
39BEEFEA233B994E001C84C3 /* _DTXIPCExportedObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _DTXIPCExportedObject.h; sourceTree = "<group>"; };
39BEEFEB233B994E001C84C3 /* _DTXIPCExportedObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = _DTXIPCExportedObject.m; sourceTree = "<group>"; };
39BEEFEE233BA85C001C84C3 /* NSInvocation+DTXRemoteSerialization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSInvocation+DTXRemoteSerialization.h"; sourceTree = "<group>"; };
39BEEFEF233BA85C001C84C3 /* NSInvocation+DTXRemoteSerialization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSInvocation+DTXRemoteSerialization.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -72,6 +75,7 @@
397D3E2E233A293D00E69D28 /* Info.plist */,
39B833D9233A7D7000DBC1D2 /* DetoxIPC.pch */,
397D3E44233A2DAB00E69D28 /* Apple */,
393A512B2357295F00DFCEF5 /* DTXIPCBase.h */,
397D3E3F233A2A4000E69D28 /* DTXIPCConnection.h */,
39BEEFE9233B895F001C84C3 /* DTXIPCConnection-Private.h */,
397D3E40233A2A4000E69D28 /* DTXIPCConnection.m */,
Expand All @@ -81,8 +85,8 @@
39BEEFEF233BA85C001C84C3 /* NSInvocation+DTXRemoteSerialization.m */,
39B833DC233A920200DBC1D2 /* _DTXIPCDistantObject.h */,
39B833DD233A920200DBC1D2 /* _DTXIPCDistantObject.m */,
39BEEFEA233B994E001C84C3 /* _DTXIPCLocalObject.h */,
39BEEFEB233B994E001C84C3 /* _DTXIPCLocalObject.m */,
39BEEFEA233B994E001C84C3 /* _DTXIPCExportedObject.h */,
39BEEFEB233B994E001C84C3 /* _DTXIPCExportedObject.m */,
);
path = DetoxIPC;
sourceTree = "<group>";
Expand All @@ -92,6 +96,7 @@
children = (
3971742D233A38EE00FFE816 /* NSConnection.h */,
39B833DB233A898400DBC1D2 /* ObjCRuntime.h */,
39A5CF072358B1A100B905F8 /* NSPortNameServer.h */,
);
path = Apple;
sourceTree = "<group>";
Expand All @@ -103,12 +108,13 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
393A512C235729B400DFCEF5 /* DTXIPCBase.h in Headers */,
39B833DE233A920200DBC1D2 /* _DTXIPCDistantObject.h in Headers */,
39BEEFE7233B87CF001C84C3 /* _DTXIPCRemoteBlockRegistry.h in Headers */,
39B833DA233A7D7000DBC1D2 /* DetoxIPC.pch in Headers */,
39BEEFF0233BA85C001C84C3 /* NSInvocation+DTXRemoteSerialization.h in Headers */,
397D3E41233A2A4000E69D28 /* DTXIPCConnection.h in Headers */,
39BEEFEC233B994E001C84C3 /* _DTXIPCLocalObject.h in Headers */,
39BEEFEC233B994E001C84C3 /* _DTXIPCExportedObject.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -180,7 +186,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
39BEEFED233B994E001C84C3 /* _DTXIPCLocalObject.m in Sources */,
39BEEFED233B994E001C84C3 /* _DTXIPCExportedObject.m in Sources */,
39BEEFF1233BA85C001C84C3 /* NSInvocation+DTXRemoteSerialization.m in Sources */,
39BEEFE8233B87CF001C84C3 /* _DTXIPCRemoteBlockRegistry.m in Sources */,
39B833DF233A920200DBC1D2 /* _DTXIPCDistantObject.m in Sources */,
Expand Down
26 changes: 26 additions & 0 deletions DetoxIPC/Apple/NSPortNameServer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// NSPortNameServer.h
// DetoxIPC
//
// Created by Leo Natan (Wix) on 10/17/19.
// Copyright © 2019 LeoNatan. All rights reserved.
//

@import Foundation;

NS_ASSUME_NONNULL_BEGIN

@interface NSPortNameServer : NSObject

+ (NSPortNameServer *)systemDefaultPortNameServer;

- (nullable NSPort *)portForName:(NSString *)name;
- (nullable NSPort *)portForName:(NSString *)name host:(nullable NSString *)host;

- (BOOL)registerPort:(NSPort *)port name:(NSString *)name;

- (BOOL)removePortForName:(NSString *)name;

@end

NS_ASSUME_NONNULL_END
11 changes: 11 additions & 0 deletions DetoxIPC/DTXIPCBase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Header.h
// DetoxIPC
//
// Created by Leo Natan (Wix) on 10/16/19.
// Copyright © 2019 LeoNatan. All rights reserved.
//

#define DTXIPC_DEPRECATED_API(x) __attribute__((deprecated(x)))

extern NSErrorDomain const DTXIPCErrorDomain;
1 change: 1 addition & 0 deletions DetoxIPC/DTXIPCConnection-Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- (oneway void)_invokeFromRemote:(NSDictionary*)serializedInvocation;
- (oneway void)_invokeRemoteBlock:(NSDictionary*)serializedBlock;
- (oneway void)_cleanupRemoteBlock:(NSString*)identifier;
- (BOOL)_ping;

@end

Expand Down
11 changes: 8 additions & 3 deletions DetoxIPC/DTXIPCConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <Foundation/Foundation.h>
#import <DetoxIPC/DTXIPCBase.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -38,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN

/// Initialize a DTXIPCConnection that will connect to specified already-registered service name.
/// @param serviceName The service name to connect to
- (instancetype)initWithRegisteredServiceName:(NSString*)serviceName;
- (instancetype)initWithRegisteredServiceName:(NSString*)serviceName DTXIPC_DEPRECATED_API("Use initWithServiceName:");

/// The registered service name.
@property (nullable, readonly, copy, nonatomic) NSString *serviceName;
Expand All @@ -61,9 +62,13 @@ NS_ASSUME_NONNULL_BEGIN
/// Returns a proxy object with no error handling block. Messages sent to the proxy object will be sent over the wire to the other side of the connection. All messages must be 'oneway void' return type. Control may be returned to the caller before the message is sent.
@property(readonly, retain, nonatomic) id remoteObjectProxy;
/// Returns a proxy object which will invoke the error handling block if an error occurs on the connection. Messages sent to the proxy object will be sent over the wire to the other side of the connection. All messages must be 'oneway void' return type. Control may be returned to the caller before the message is sent.
- (id)remoteObjectProxyWithErrorHandler:(void (^)(NSError *error))handler NS_UNAVAILABLE;
- (id)remoteObjectProxyWithErrorHandler:(void (^)(NSError *error))handler;
/// Make a synchronous IPC call instead of the default async behavior. The error handler block and block arguments will be invoked on the calling thread before the message to the proxy returns, instead of on the queue for the connection.
- (id)synchronousRemoteObjectProxyWithErrorHandler:(void (^)(NSError *error))handler NS_UNAVAILABLE;
///
/// Synchronous calls will block until the remote has released all argument blocks.
///
/// You must not send messages from multiple threads to synchronous proxies.
- (id)synchronousRemoteObjectProxyWithErrorHandler:(void (^)(NSError *error))handler;

/// Invalidate the connection. All outstanding error handling blocks will be called on the message handling queue. The connection must be invalidated before it is deallocated. After a connection is invalidated, no more messages may be sent or received.
- (void)invalidate;
Expand Down
86 changes: 54 additions & 32 deletions DetoxIPC/DTXIPCConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@

#import "DTXIPCConnection-Private.h"
#import "NSConnection.h"
#import "NSPortNameServer.h"
#import "ObjCRuntime.h"
#import "_DTXIPCDistantObject.h"
#import "_DTXIPCLocalObject.h"
#import "_DTXIPCExportedObject.h"
#import "_DTXIPCRemoteBlockRegistry.h"
@import ObjectiveC;

NSErrorDomain const DTXIPCErrorDomain = @"DTXIPCErrorDomain";

@interface DTXIPCInterface ()

@property (nonatomic, readwrite) Protocol* protocol;
Expand Down Expand Up @@ -179,29 +182,35 @@ - (NSMethodSignature *)protocolMethodSignatureForSelector:(SEL)aSelector

@implementation DTXIPCConnection
{
dispatch_queue_t _dispatchQueue;
NSRunLoop* _runLoop;
NSString* _actualServiceName;
}

- (void)_runThread
- (void)_runQueue
{
NSThread.currentThread.name = [NSString stringWithFormat:@"com.wix.DTXIPCConnection:%@", _serviceName];

_runLoop = NSRunLoop.currentRunLoop;

[_connection run];
}

- (void)_commonInit
- (BOOL)_commonInit
{
NSPort* port = NSPort.port;
if([NSPortNameServer.systemDefaultPortNameServer registerPort:port name:_actualServiceName] == NO)
{
return NO;
}

_connection = [NSConnection connectionWithReceivePort:port sendPort:nil];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_mainConnectionDidDie:) name:NSConnectionDidDieNotification object:_connection];
_connection.rootObject = self;
[_connection registerName:_serviceName];

[NSThread detachNewThreadSelector:@selector(_runThread) toTarget:self withObject:nil];
// [_connection runInNewThread];
dispatch_async(_dispatchQueue, ^{
[self _runQueue];
});

return YES;
}

- (instancetype)initWithServiceName:(NSString *)serviceName
Expand All @@ -210,28 +219,31 @@ - (instancetype)initWithServiceName:(NSString *)serviceName
if(self)
{
_serviceName = serviceName;
_actualServiceName = serviceName;
_slave = NO;

[self _commonInit];
_dispatchQueue = dispatch_queue_create([NSString stringWithFormat:@"com.wix.DTXIPCConnection:%@", serviceName].UTF8String, NULL);

//Attempt becoming a master
if([self _commonInit] == NO)
{
_actualServiceName = [NSString stringWithFormat:@"%@.slave", serviceName];
_slave = YES;

//Attempt becoming the slave
NSAssert([self _commonInit] == YES, @"The service “%@” already has ", serviceName);

_otherConnection = [NSConnection connectionWithRegisteredName:serviceName host:nil];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_otherConnectionDidDie:) name:NSConnectionDidDieNotification object:_otherConnection];
[(id)_otherConnection.rootProxy _slaveDidConnectWithName:_actualServiceName];
}
}
return self;
}

- (instancetype)initWithRegisteredServiceName:(NSString *)serviceName
{
self = [super init];
if(self)
{
_serviceName = [NSString stringWithFormat:@"%@.slave", serviceName];
_slave = YES;

[self _commonInit];

_otherConnection = [NSConnection connectionWithRegisteredName:serviceName host:nil];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_otherConnectionDidDie:) name:NSConnectionDidDieNotification object:_otherConnection];
[(id)_otherConnection.rootProxy _slaveDidConnectWithName:_serviceName];
}
return self;
return [self initWithServiceName:serviceName];
}

- (void)_mainConnectionDidDie:(NSNotification*)note
Expand All @@ -246,7 +258,8 @@ - (void)_mainConnectionDidDie:(NSNotification*)note
{
block();
}
[NSThread exit];

CFRunLoopStop(CFRunLoopGetCurrent());
}];
}

Expand All @@ -271,17 +284,17 @@ - (BOOL)isValid

- (id)remoteObjectProxy
{
return [_DTXIPCDistantObject _distantObjectWithConnection:self remoteInterface:self.remoteObjectInterface synchronous:NO errorBlock:nil];
return [_DTXIPCDistantObject _distantObjectWithConnection:self synchronous:NO errorBlock:nil];
}

- (id)remoteObjectProxyWithErrorHandler:(void (^)(NSError * _Nonnull))handler
{
return [_DTXIPCDistantObject _distantObjectWithConnection:self remoteInterface:self.remoteObjectInterface synchronous:NO errorBlock:handler];
return [_DTXIPCDistantObject _distantObjectWithConnection:self synchronous:NO errorBlock:handler];
}

- (id)synchronousRemoteObjectProxyWithErrorHandler:(void (^)(NSError * _Nonnull))handler
{
return [_DTXIPCDistantObject _distantObjectWithConnection:self remoteInterface:self.remoteObjectInterface synchronous:YES errorBlock:handler];
return [_DTXIPCDistantObject _distantObjectWithConnection:self synchronous:YES errorBlock:handler];
}

- (void)setExportedObject:(id)exportedObject
Expand All @@ -300,20 +313,29 @@ - (oneway void)_slaveDidConnectWithName:(NSString*)slaveServiceName

- (oneway void)_invokeFromRemote:(NSDictionary*)serializedInvocation
{
_DTXIPCLocalObject* localObj = [_DTXIPCLocalObject _localObjectWithObject:self.exportedObject connection:self localInterface:self.exportedInterface];
[localObj invokeWithSerializedInvocation:serializedInvocation];
_DTXIPCExportedObject* exportedObj = [_DTXIPCExportedObject _exportedObjectWithObject:self.exportedObject connection:self serializedInvocation:serializedInvocation];
[exportedObj invoke];
}

- (oneway void)_invokeRemoteBlock:(NSDictionary*)serializedBlock
{
id localBlock = [_DTXIPCRemoteBlockRegistry remoteBlockForIdentifier:serializedBlock[@"remoteBlockIdentifier"]];
_DTXIPCLocalObject* localObj = [_DTXIPCLocalObject _localObjectWithObject:localBlock connection:self localInterface:self.exportedInterface];
[localObj invokeWithSerializedInvocation:serializedBlock];
_DTXIPCDistantObject* distantObject;
id localBlock = [_DTXIPCRemoteBlockRegistry remoteBlockForIdentifier:serializedBlock[@"remoteBlockIdentifier"] distantObject:&distantObject];
_DTXIPCExportedObject* exportedObj = [_DTXIPCExportedObject _exportedObjectWithObject:localBlock connection:self serializedInvocation:serializedBlock];
if([distantObject _enqueueSynchronousExportedObjectInvocation:exportedObj] == NO)
{
[exportedObj invoke];
}
}

- (oneway void)_cleanupRemoteBlock:(NSString*)identifier
{
[_DTXIPCRemoteBlockRegistry cleanupRemoteBlock:identifier];
[_DTXIPCRemoteBlockRegistry releaseRemoteBlock:identifier];
}

- (BOOL)_ping
{
return YES;
}

@end
1 change: 1 addition & 0 deletions DetoxIPC/DetoxIPC.pch
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ static void defer_cleanup_block(__strong void(^*block)(void)) {
#pragma clang diagnostic pop

#define free_if_needed(x) do { if(x != NULL) { free(x); }} while(0)
#define autoreleasing_lock(lock) do { pthread_mutex_lock(lock); dtx_defer { pthread_mutex_unlock(lock); }; } while(0)

#endif /* Detox_pch */
2 changes: 1 addition & 1 deletion DetoxIPC/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
3 changes: 2 additions & 1 deletion DetoxIPC/NSInvocation+DTXRemoteSerialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

#import <Foundation/Foundation.h>
@class DTXIPCConnection;
@class _DTXIPCDistantObject;

NS_ASSUME_NONNULL_BEGIN

extern void* _DTXRemoteBlockIdentifierKey;

@interface NSInvocation (DTXRemoteSerialization)

- (NSDictionary*)_dtx_serializedDictionary;
- (NSDictionary*)_dtx_serializedDictionaryForDistantObject:(nullable _DTXIPCDistantObject*)distantObject;

+ (instancetype)_dtx_invocationWithSerializedDictionary:(NSDictionary*)serialized remoteConnection:(DTXIPCConnection*)connection;

Expand Down
Loading

0 comments on commit bd014ec

Please sign in to comment.