Next Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

NSPort

Inherits from
Package
com.apple.cocoa.foundation
Companion guide

Overview

NSPort is an abstract class that represents a communication channel to or from another NSPort, which typically resides in a different thread or task.

To receive incoming messages, NSPorts must be added to an NSRunLoop as input sources.

Tasks

Constructors

Validation

Setting the Delegate

Constructors

NSPort

Creates a new NSPort object capable of both sending and receiving messages.

public NSPort()

Creates a newly allocated NSPort object to use the Mach port machPort.

public NSPort(int machPort)

Discussion

Depending on the access rights for machPort, the new NSPort may only be able to send messages.

Instance Methods

delegate

Returns the receiver’s delegate.

public Object delegate()

See Also

invalidate

Marks the receiver as invalid.

public void invalidate()

See Also

isValid

Returns false if the receiver is known to be invalid, true otherwise (an NSPort only notes that it has become invalid when it tries to send or receive a message).

public boolean isValid()

Discussion

An NSPort becomes invalid when its underlying communication resource, which is operating system dependent, is closed or damaged.

See Also

setDelegate

public void setDelegate(Object anObject)

Discussion

Sets the receiver’s delegate to anObject.

See Also


Next Page > Hide TOC


© 1997, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-07-24)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.