NSNetServiceListenForConnections option implemented for GSAvahiNetService

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37521 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcus Müller 2013-12-26 23:16:36 +00:00
parent adc50bb90f
commit 6dd4f6fba1
3 changed files with 104 additions and 16 deletions

View file

@ -93,7 +93,10 @@ enum
typedef NSUInteger NSNetServicesError;
enum {
NSNetServiceNoAutoRename = 1 << 0
NSNetServiceNoAutoRename = 1 << 0
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9,GS_API_LATEST)
,NSNetServiceListenForConnections = 1 << 1
#endif
};
typedef NSUInteger NSNetServiceOptions;
@ -202,6 +205,22 @@ GS_EXPORT NSString * const NSNetServicesErrorDomain;
- (void) netService: (NSNetService *) sender
didUpdateTXTRecordData: (NSData *) data;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9,GS_API_LATEST)
/**
* Notifies the delegate that the service, which must have been published with
* option NSNetServiceListenForConnections, received a new connection.
* In order to communicate with the connecting client, you must -open
* the streams and schedule them with a runloop.
* To reject a connection, just -open and immediately -close both streams.
*/
- (void) netService: (NSNetService *) sender
didAcceptConnectionWithInputStream: (NSInputStream *) inputStream
outputStream: (NSOutputStream *)outputStream;
#endif
@end
/**