| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in Mac OS X v10.6 and later. |
| Companion guide | |
| Declared in | NSConnection.h |
| Related sample code |
The NSConnectionDelegate protocol defines the optional methods implemented by delegates of NSConnection objects.
Returns a Boolean value that indicates whether given authentication data is valid for a given set of components.
- (BOOL)authenticateComponents:(NSArray *)components withData:(NSData *)authenticationData
An array that contains NSData and NSPort objects belonging to an NSPortMessage object. See the NSPortMessage class specification for more information.
Authentication data created by the delegate of the peer NSConnection object with authenticationDataForComponents:.
YES if the authenticationData provided is valid for components, otherwise NO.
Use this message for validation of incoming messages. An NSConnection object raises an NSFailedAuthenticationException on receipt of a remote message the delegate doesn’t authenticate.
NSConnection.hReturns an NSData object to be used as an authentication stamp for an outgoing message.
- (NSData *)authenticationDataForComponents:(NSArray *)components
An array containing the elements of a network message, in the form of NSPort and NSData objects.
An NSData object to be used as an authentication stamp for an outgoing message.
The delegate should use only the NSData elements to create the authentication stamp. See the NSPortMessage class specification for more information on the components.
If authenticationDataForComponents: returns nil, an NSGenericException will be raised. If the delegate determines that the message shouldn’t be authenticated, it should return an empty NSData object. The delegate on the other side of the connection must then be prepared to accept an empty NSData object as the second parameter to authenticateComponents:withData: and to handle the situation appropriately.
The components parameter will be validated on receipt by the delegate of the peer NSConnection object with authenticateComponents:withData:.
NSConnection.hThis method should be implemented by NSConnection object delegates that want to intercept distant object requests.
- (BOOL)connection:(NSConnection *)conn handleRequest:(NSDistantObjectRequest *)doReq
The connection object for which the receiver is the delegate.
The distant object request.
YES if the request was handled by the delegate, NO if the request should proceed as if the delegate did not intercept it.
NSConnection.hReturns a Boolean value that indicates whether the parent connection should allow a given new connection to be created.
- (BOOL)connection:(NSConnection *)parentConnection shouldMakeNewConnection:(NSConnection *)newConnnection
The connection object for which the receiver is the delegate.
The new connection.
YES if parentConnection should allow newConnnection to be created and set up, NO if parentConnection should refuse and immediately release newConnection.
Use this method to limit the amount of NSConnection objects created in your application or to change the parameters of child NSConnection objects.
Use NSConnectionDidInitializeNotification instead of this delegate method if possible.
NSConnection.hReturns an arbitrary object identifying a new conversation being created for the connection in the current thread.
- (id)createConversationForConnection:(NSConnection *)conn
The connection object for which the receiver is the delegate.
An arbitrary object identifying a new conversation being created for the connection in the current thread.
New conversations are created only if independentConversationQueueing is YES for conn. If you do not implement this method, NSConnection object creates an instance of NSObject.
+ currentConversationconversation (NSDistantObjectRequest)NSConnection.hReturns a Boolean value that indicates whether the parent should allow a given new connection to be created and configured.
- (BOOL)makeNewConnection:(NSConnection *)newConnection sender:(NSConnection *)parentConnection
The new connection.
The parent connection.
YES if parentConnection should allow newConnnection to be created and configured, NO if parentConnection should refuse and immediately release newConnection.
Use this method to limit the number of NSConnection objects created in your application or to change the parameters of child NSConnection objects.
Use NSConnectionDidInitializeNotification instead of this delegate method if possible.
NSConnection.hLast updated: 2009-04-15