Sha256: afdc8caf86f16df8a19654038a7c75a612a38187923af810fe4fa365c8c177dd

Contents?: true

Size: 1021 Bytes

Versions: 6

Compression:

Stored size: 1021 Bytes

Contents

#import <Foundation/Foundation.h>

@class wax_server;

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 <NSStreamDelegate, NSNetServiceDelegate> {	
	CFSocketRef _ipv4socket;
	id<WaxServerDelegate> _delegate;

	NSNetService *_netService;
	NSInputStream *_inStream;
	NSOutputStream *_outStream;
}
	
@property(nonatomic, assign) id<WaxServerDelegate> 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 <WaxServerDelegate> {} 
@end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
candle-0.0.7 lib/candle/generators/lua/wax/lib/wax_server.h
candle-0.0.6 lib/candle/generators/lua/wax/lib/wax_server.h
candle-0.0.4 lib/candle/generators/lua/wax/lib/wax_server.h
candle-0.0.3 lib/candle/generators/lua/wax/lib/wax_server.h
candle-0.0.2 lib/candle/generators/lua/wax/lib/wax_server.h
candle-0.0.1 lib/candle/generators/lua/wax/lib/wax_server.h