// Ports encode themselves for NSPortCoder, but not for generic NSCoders
// For NSPortCoder, send rights for the ports are distributed
@private
unsigned isValid:1;
unsigned isDying:1;
unsigned filler:6;
unsigned refCount:24;
int machPort;
id delegate;
void *reserved;
}
+ (NSPort *)port;
// allocate and autorelease a new port
+ (NSPort *)portWithMachPort:(int)machPort;
// Argument should be a port_t (we don't type with port_t to avoid importing Mach header files)
// autoreleased; non portable
- (id)initWithMachPort:(int)machPort;
// Argument should be a port_t
// may substitute an already allocated and initialized instance
- (void)invalidate;
- (int)machPort;
/* Access to machPort should be avoided when possible to ensure portability */
// returned value is a port_t
- (id)setDelegate:(id)anId;
/* A port delegate will be offered a couple opportunities to handle messages by means of handleMachMessage: or handlePortMessage: (see NSPortMessage API) */
- delegate;
- (BOOL)isValid;
/* returns NO if port is known to be invalid, YES if port may be valid */
/* the first time that a port discovers that it is invalid it posts
the event {name = NSPortDidBecomeInvalidNotification; sender = port} */
@end
/* A port delegate will be offered a couple opportunities to handle messages. Implement one only: */