Class: NSPort
Overview
NSPort is an abstract class that represents a communication channel. Communication occurs between NSPort objects, which typically reside in different threads or tasks. The distributed objects system uses NSPort objects to send NSPortMessage objects back and forth. You should implement interapplication communication using distributed objects whenever possible and use NSPort objects only when necessary.
Direct Known Subclasses
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- delegate
Returns the receiver’s delegate.
-
- invalidate
Marks the receiver as invalid and posts an NSPortDidBecomeInvalidNotification to the default notification center.
-
- isValid
Returns a Boolean value that indicates whether the receiver is valid.
-
- removeFromRunLoop:forMode:
This method should be implemented by a subclass to stop monitoring of a port when removed from a give run loop in a given input mode.
-
- reservedSpaceLength
Returns the number of bytes of space reserved by the receiver for sending data.
-
- scheduleInRunLoop:forMode:
This method should be implemented by a subclass to set up monitoring of a port when added to a given run loop in a given input mode.
-
- sendBeforeDate:components:from:reserved:
This method is provided for subclasses that have custom types of NSPort.
-
- sendBeforeDate:msgid:components:from:reserved:
This method is provided for subclasses that have custom types of NSPort.
-
- setDelegate:
Sets the receiver’s delegate to a given object.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Class Method Details
Instance Method Details
- (Object) delegate
Returns the receiver’s delegate.
- (Object) invalidate
Marks the receiver as invalid and posts an NSPortDidBecomeInvalidNotification to the default notification center. You must call this method before releasing a port object (or removing strong references to it if your application is garbage collected).
- (Boolean) isValid
Returns a Boolean value that indicates whether the receiver is valid. An NSPort object becomes invalid when its underlying communication resource, which is operating system dependent, is closed or damaged.
- (Object) removeFromRunLoop(runLoop, forMode:mode)
This method should be implemented by a subclass to stop monitoring of a port when removed from a give run loop in a given input mode. This method should not be called directly.
- (Integer) reservedSpaceLength
Returns the number of bytes of space reserved by the receiver for sending data.
- (Object) scheduleInRunLoop(runLoop, forMode:mode)
This method should be implemented by a subclass to set up monitoring of a port when added to a given run loop in a given input mode. This method should not be called directly.
- (Boolean) sendBeforeDate(limitDate, components:components, from:receivePort, reserved:headerSpaceReserved)
This method is provided for subclasses that have custom types of NSPort. NSConnection calls this method at the appropriate times. This method should not be called directly. This method could raise an NSInvalidSendPortException, NSInvalidReceivePortException, or an NSPortSendException, depending on the type of send port and the type of error.
- (Boolean) sendBeforeDate(limitDate, msgid:msgID, components:components, from:receivePort, reserved:headerSpaceReserved)
This method is provided for subclasses that have custom types of NSPort. NSConnection calls this method at the appropriate times. This method should not be called directly. This method could raise an NSInvalidSendPortException, NSInvalidReceivePortException, or an NSPortSendException, depending on the type of send port and the type of error.
- (Object) setDelegate(anObject)
Sets the receiver’s delegate to a given object.