218
@interface Object (NSConnectionDelegate)
220
* This method may be used to ask a delegate's permission to create
221
* a new connection from the old one.
222
* This method should be implemented in preference to the
223
* [makeNewConnection:sender:] which is obsolete.
225
- (BOOL) connection: (NSConnection*)parent
221
* This category represents an informal protocol to which NSConnection
222
* delegates may conform ... These methods are not actually implemented
223
* by NSObject, so implementing these methods in your class has the effect
226
@interface NSObject (NSConnectionDelegate)
230
* This is not an NSConnection method, but is a method that may
231
* be implemented by the delegate of an NSConnection object.
234
* If the delegate implements this method, the NSConnection will
235
* invoke the method for every message request or reply it receives
236
* from the remote NSConnection. The delegate should use the
237
* authentication data to check all the NSData objects
238
* in the components array (ignoring NSPort objects),
239
* and return YES if they are valid, NO otherwise.
242
* If the method returns NO then an
243
* NSFailedAuthentication exception will be raised.
246
* In GNUstep the components array is mutable, allowing
247
* you to replace the NSData objects with your own version.
250
- (BOOL) authenticateComponents: (NSMutableArray*)components
251
withData: (NSData*)authenticationData;
255
* This is not an NSConnection method, but is a method that may
256
* be implemented by the delegate of an NSConnection object.
259
* If the delegate implements this method, the NSConnection will
260
* invoke the method for every message request to reply it sends
261
* to the remote NSConnection. The delegate should generate
262
* authentication data by examining all the NSData objects
263
* in the components array (ignoring NSPort objects),
264
* and return the authentication data that can be used by the
265
* remote NSConnection.
268
* If the method returns nil then an
269
* NSGenericException exception will be raised.
272
* In GNUstep the components array is mutable, allowing
273
* you to replace the NSData objects with your own version.
276
- (NSData*) authenticationDataForComponents: (NSMutableArray*)components;
280
* This is not an NSConnection method, but is a method that may
281
* be implemented by the delegate of an NSConnection object.
284
* If the delegate implements this method, it will be called
285
* whenever a new NSConnection is created that has this
286
* NSConnection as its parent. The delegate may take this
287
* opportunity to adjust the configuration of the new
288
* connection and may return a boolean value to tell the
289
* parent whether the creation of the new connection is to
290
* be permitted or not.
293
- (BOOL) connection: (NSConnection*)parent
226
294
shouldMakeNewConnection: (NSConnection*)newConnection;
229
* This is the old way of doing the same thing as
230
* [connection:shouldMakeNewConnection:]
231
* It is obsolete - don't use it.
233
- (BOOL) makeNewConnection: (NSConnection*)newConnection
234
sender: (NSConnection*)parent;
237
* If the delegate responds to this method, it will be used to ask the
238
* delegate's permission to establish a new connection from the old one.
239
* Often this is used so that the delegate can register for invalidation
240
* notification on new child connections.
241
* This is a GNUstep extension
242
* Normally return newConn.
244
296
- (NSConnection*) connection: (NSConnection*)ancestorConn
245
297
didConnect: (NSConnection*)newConn;
248
* These are like the MacOS-X delegate methods, except that we provide the
249
* components in mutable arrays, so that the delegate can alter the data
250
* items in the array. Of course, you must do that WITH CARE.
252
- (BOOL) authenticateComponents: (NSMutableArray*)components
253
withData: (NSData*)authenticationData;
256
* These are like the MacOS-X delegate methods, except that we provide the
257
* components in mutable arrays, so that the delegate can alter the data
258
* items in the array. Of course, you must do that WITH CARE.
260
- (NSData*) authenticationDataForComponents: (NSMutableArray*)components;
265
* This informal protocol allows an object to control the details of how an
266
* object is sent over the wire in distributed objects Port communications.
268
@interface Object (NSPortCoder)
270
* Must return the class that will be created on the remote side
271
* of the connection. If the class to be created is not the same
272
* as that of the object returned by replacementObjectForPortCoder:
273
* then the class must be capable of recognising the object it
274
* actually gets in its initWithCoder: method.
275
* The default operation is to return NSDistantObject unless the
276
* object is being sent bycopy, in which case the objects actual
277
* class is returned. To force bycopy operation the object should
278
* return its own class.
280
- (Class) classForPortCoder;
283
* This message is sent to an object about to be encoded for sending
284
* over the wire. The default action is to return an NSDistantObject
285
* which is a local proxy for the object unless the object is being
286
* sent bycopy, in which case the actual object is returned.
287
* To force bycopy, an object should return itself.
289
- (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder;
300
* An old fashioned synonym for -connection:shouldMakeNewConnection: -
303
- (BOOL) makeNewConnection: (NSConnection*)newConnection
304
sender: (NSConnection*)parent;