DTBonjourServer Class Reference
| Inherits from | NSObject | 
| Conforms to | DTBonjourDataConnectionDelegate | 
| Declared in | DTBonjourServer.h | 
Overview
This class represents a service that clients can connect to. It owns its inbound connections and thus you should never modify the delegate of the individual data connections.
On iOS the server is automatically stopped if the app enters the background and restarted when the app comes back into the foreground.
Tasks
Creating a Server
Server Lifetime
Sending Objects
Getting Information
- 
	
		
delegateproperty - 
	
		
portproperty - 
	
		
connectionsproperty - 
	
		
TXTRecordproperty 
Properties
TXTRecord
The TXT Record attached to the Bonjour service.
@property (nonatomic, strong) NSDictionary *TXTRecordDiscussion
Updating this property while the server is running will update the broadcast TXTRecord. The server has its own instance of the TXTRecord so that it can be set even before calling start.
Declared In
DTBonjourServer.hconnections
The currently connected inbound DTBonjourDataConnection instances.
@property (nonatomic, readonly) NSSet *connectionsDeclared In
DTBonjourServer.hdelegate
The delegate that will be informed about activities happening on the server.
@property (nonatomic, weak) id<DTBonjourServerDelegate> delegateDeclared In
DTBonjourServer.hport
The actual port bound to, valid after start
@property (nonatomic, assign, readonly) NSUInteger portDeclared In
DTBonjourServer.hInstance Methods
broadcastObject:
Sends the object to all currently connected clients.
- (void)broadcastObject:(id)objectParameters
- object
 The object that will be encoded and sent to all clients
Discussion
Note: any errors will be ignored. If you require finer-grained control then you should iterate over the individual connections.
Declared In
DTBonjourServer.hinitWithBonjourType:
Creates a server instances with the given bonjour type, e.g. “servicename.tcp”
- (id)initWithBonjourType:(NSString *)bonjourTypeParameters
- bonjourType
 The full service type string
Declared In
DTBonjourServer.h