#import @class wax_server; extern NSString * const TCPServerErrorDomain; typedef enum { kTCPServerCouldNotBindToIPv4Address = 1, kTCPServerCouldNotBindToIPv6Address = 2, kTCPServerNoSocketsAvailable = 3, } TCPServerErrorCode; @protocol WaxServerDelegate @optional - (void)connected; - (void)disconnected; - (void)dataReceived:(NSData *)data; @end @interface wax_server : NSObject { CFSocketRef _ipv4socket; id _delegate; NSNetService *_netService; NSInputStream *_inStream; NSOutputStream *_outStream; } @property(nonatomic, assign) id delegate; - (NSError *)startOnPort:(NSUInteger)port; - (BOOL)stop; - (BOOL)enableBonjourOnPort:(NSUInteger)port; - (void)disableBonjour; - (BOOL)send:(NSString *)output; - (void)receive:(NSData *)output; @end // This is needed because the runtime doesn't automatically load protocols @interface HACK_WAX_DELEGATE_IMPLEMENTOR : NSObject {} @end