Package apple.foundation
Class NSNetService
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.foundation.NSNetService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNSNetService(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()NSArray<? extends NSData>addresses()The addresses of the service.static NSNetServicealloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()static NSDatadataFromTXTRecordDictionary(NSDictionary<java.lang.String,? extends NSData> txtDictionary)Returns an NSData created from the provided dictionary.static java.lang.StringdebugDescription_static()NSNetServiceDelegatedelegate()Set a delegate to receive publish, resolve, or monitor events.static java.lang.Stringdescription_static()static NSDictionary<java.lang.String,? extends NSData>dictionaryFromTXTRecordData(NSData txtData)Returns an NSDictionary created from the provided NSData.java.lang.Stringdomain()Returns the domain of the discovered or published service.booleangetInputStreamOutputStream(org.moe.natj.general.ptr.Ptr<NSInputStream> inputStream, org.moe.natj.general.ptr.Ptr<NSOutputStream> outputStream)Retrieves streams from the NSNetService instance.static longhash_static()java.lang.StringhostName()Returns the DNS host name of the computer hosting the discovered or published service.booleanincludesPeerToPeer()Initially set to NO.NSNetServiceinit()NSNetServiceinitWithDomainTypeName(java.lang.String domain, java.lang.String type, java.lang.String name)This is the initializer for resolution.NSNetServiceinitWithDomainTypeNamePort(java.lang.String domain, java.lang.String type, java.lang.String name, int port)This is the initializer for publishing.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)java.lang.Stringname()Returns the name of the discovered or published service.static java.lang.Objectnew_objc()longport()The port of a resolved service.voidpublish()Advertises a given service on the network.voidpublishWithOptions(long options)Advertises a given service on the network.voidremoveFromRunLoopForMode(NSRunLoop aRunLoop, java.lang.String mode)voidresolve()Deprecated.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidresolveWithTimeout(double timeout)Starts a resolve for the NSNetService instance of the specified duration.voidscheduleInRunLoopForMode(NSRunLoop aRunLoop, java.lang.String mode)NSNetService instances may be scheduled on NSRunLoops to operate in different modes, or in other threads.voidsetDelegate(NSNetServiceDelegate value)Set a delegate to receive publish, resolve, or monitor events.voidsetDelegate_unsafe(NSNetServiceDelegate value)Set a delegate to receive publish, resolve, or monitor events.voidsetIncludesPeerToPeer(boolean value)Initially set to NO.booleansetTXTRecordData(NSData recordData)Sets the TXT record of the NSNetService instance that has been or will be published.static voidsetVersion_static(long aVersion)voidstartMonitoring()Starts monitoring the NSNetService instance for events.voidstop()Halts a service which is either publishing or resolving.voidstopMonitoring()Stops monitoring the NSNetService instance for events.static org.moe.natj.objc.Classsuperclass_static()NSDataTXTRecordData()Returns the raw TXT record of the NSNetService instance.java.lang.Stringtype()Returns the type of the discovered or published service.static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static NSNetService alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
dataFromTXTRecordDictionary
public static NSData dataFromTXTRecordDictionary(NSDictionary<java.lang.String,? extends NSData> txtDictionary)
Returns an NSData created from the provided dictionary. The keys in the provided dictionary must be NSStrings, and the values must be NSDatas. If the dictionary cannot be converted into an NSData suitable for a TXT record, this method will return nil. For applications linked on or after Mac OS X 10.5, this method will throw an NSInvalidArgumentException if it is passed nil as the argument.
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
dictionaryFromTXTRecordData
public static NSDictionary<java.lang.String,? extends NSData> dictionaryFromTXTRecordData(NSData txtData)
Returns an NSDictionary created from the provided NSData. The keys will be UTF8-encoded NSStrings. The values are NSDatas. The caller is responsible for interpreting these as types appropriate to the keys. If the NSData cannot be converted into an appropriate NSDictionary, this method will return nil. For applications linked on or after Mac OS X 10.5, this method will throw an NSInvalidException if it is passed nil as the argument.
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
TXTRecordData
public NSData TXTRecordData()
Returns the raw TXT record of the NSNetService instance. If the instance has not been resolved, or the delegate's -netService:didUpdateTXTRecordData: has not been called, this will return nil. It is permitted to have a zero-length TXT record.
-
addresses
public NSArray<? extends NSData> addresses()
The addresses of the service. This is an NSArray of NSData instances, each of which contains a single struct sockaddr suitable for use with connect(2). In the event that no addresses are resolved for the service or the service has not yet been resolved, an empty NSArray is returned.
-
delegate
public NSNetServiceDelegate delegate()
Set a delegate to receive publish, resolve, or monitor events.
-
domain
public java.lang.String domain()
Returns the domain of the discovered or published service.
-
getInputStreamOutputStream
public boolean getInputStreamOutputStream(org.moe.natj.general.ptr.Ptr<NSInputStream> inputStream, org.moe.natj.general.ptr.Ptr<NSOutputStream> outputStream)
Retrieves streams from the NSNetService instance. The instance's delegate methods are not called. Returns YES if the streams requested are created successfully. Returns NO if or any reason the stream could not be created. If only one stream is desired, pass NULL for the address of the other stream. The streams that are created are not open, and are not scheduled in any run loop for any mode.
-
hostName
public java.lang.String hostName()
Returns the DNS host name of the computer hosting the discovered or published service. If a successful resolve has not yet occurred, this method will return nil.
-
includesPeerToPeer
public boolean includesPeerToPeer()
Initially set to NO. Set to YES to also publish, resolve, or monitor this service over peer to peer Wi-Fi (if available). Must be set before operation starts.
-
init
public NSNetService init()
-
initWithDomainTypeName
public NSNetService initWithDomainTypeName(java.lang.String domain, java.lang.String type, java.lang.String name)
This is the initializer for resolution. If you know the domain, type and name of the service for which you wish to discover addresses, you should initialize an NSNetService instance using this method and call resolve: on the result. If you wish to connect to this service immediately, you should call getInputStream:getOutputStream: on the result and forego the resolution step entirely. If publish: is called on an NSNetService instance initialized with this method, an NSNetServicesBadArgumentError will be sent in the error dictionary to the delegate's netService:didNotPublish: method.
-
initWithDomainTypeNamePort
public NSNetService initWithDomainTypeNamePort(java.lang.String domain, java.lang.String type, java.lang.String name, int port)
This is the initializer for publishing. You should use this initializer if you are going to announce the availability of a service on the network. To publish a service in all available domains, pass the empty string as the domain.
-
name
public java.lang.String name()
Returns the name of the discovered or published service.
-
port
public long port()
The port of a resolved service. This returns -1 if the service has not been resolved.
-
publish
public void publish()
Advertises a given service on the network. This method returns immediately. Success or failure is indicated by callbacks to the NSNetService instance's delegate. If the name of the service is the default name (@""), then the service will be renamed automatically. If the name of the service has been specified, then the service will not be renamed automatically. If more control over renaming is required, then -[NSNetService publishWithOptions:] is available.
-
publishWithOptions
public void publishWithOptions(long options)
Advertises a given service on the network. This method returns immediately. Success or failure is indicated by callbacks to the NSNetService instance's delegate. See the notes above for NSNetServiceNoAutoRename for information about controlling the auto-renaming behavior using this method.
-
removeFromRunLoopForMode
public void removeFromRunLoopForMode(NSRunLoop aRunLoop, java.lang.String mode)
-
resolve
@Deprecated public void resolve()
Deprecated.Attempts to determine at least one address for the NSNetService instance. For applications linked on or after Mac OS X 10.4 "Tiger", this method calls -resolveWithTimeout: with a value of 5.0. Applications linked prior to Mac OS X 10.4 "Tiger" must call -stop on the instance after an appropriate (short) amount of time to avoid causing unnecessary network traffic.
-
resolveWithTimeout
public void resolveWithTimeout(double timeout)
Starts a resolve for the NSNetService instance of the specified duration. If the delegate's -netServiceDidResolveAddress: method is called before the timeout expires, the resolve is successful. If the timeout is reached, the delegate's -netService:didNotResolve: method will be called. The value of the NSNetServicesErrorCode key in the error dictionary will be NSNetServicesTimeoutError.
-
scheduleInRunLoopForMode
public void scheduleInRunLoopForMode(NSRunLoop aRunLoop, java.lang.String mode)
NSNetService instances may be scheduled on NSRunLoops to operate in different modes, or in other threads. It is generally not necessary to schedule NSNetServices in other threads. NSNetServices are scheduled in the current thread's NSRunLoop in the NSDefaultRunLoopMode when they are created.
-
setDelegate_unsafe
public void setDelegate_unsafe(NSNetServiceDelegate value)
Set a delegate to receive publish, resolve, or monitor events.
-
setDelegate
public void setDelegate(NSNetServiceDelegate value)
Set a delegate to receive publish, resolve, or monitor events.
-
setIncludesPeerToPeer
public void setIncludesPeerToPeer(boolean value)
Initially set to NO. Set to YES to also publish, resolve, or monitor this service over peer to peer Wi-Fi (if available). Must be set before operation starts.
-
setTXTRecordData
public boolean setTXTRecordData(NSData recordData)
Sets the TXT record of the NSNetService instance that has been or will be published. Pass nil to remove the TXT record from the instance.
-
startMonitoring
public void startMonitoring()
Starts monitoring the NSNetService instance for events. In Mac OS X 10.4 Tiger, monitored NSNetService instances inform their delegates of changes to the instance's TXT record by calling the delegate's -netService:didUpdateTXTRecordData: method.
-
stop
public void stop()
Halts a service which is either publishing or resolving.
-
stopMonitoring
public void stopMonitoring()
Stops monitoring the NSNetService instance for events.
-
type
public java.lang.String type()
Returns the type of the discovered or published service.
-
-