123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- #import <Foundation/Foundation.h>
- @class GCDAsyncSocket;
- @class WebSocket;
- #if TARGET_OS_IPHONE
- #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
- #define IMPLEMENTED_PROTOCOLS <NSNetServiceDelegate>
- #else
- #define IMPLEMENTED_PROTOCOLS
- #endif
- #else
- #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- #define IMPLEMENTED_PROTOCOLS <NSNetServiceDelegate>
- #else
- #define IMPLEMENTED_PROTOCOLS
- #endif
- #endif
- @interface HTTPServer : NSObject IMPLEMENTED_PROTOCOLS
- {
-
- GCDAsyncSocket *asyncSocket;
-
-
- dispatch_queue_t serverQueue;
- dispatch_queue_t connectionQueue;
- void *IsOnServerQueueKey;
- void *IsOnConnectionQueueKey;
-
-
- NSString *documentRoot;
- Class connectionClass;
- NSString *interface;
- UInt16 port;
-
-
- NSNetService *netService;
- NSString *domain;
- NSString *type;
- NSString *name;
- NSString *publishedName;
- NSDictionary *txtRecordDictionary;
-
-
- NSMutableArray *connections;
- NSMutableArray *webSockets;
- NSLock *connectionsLock;
- NSLock *webSocketsLock;
-
- BOOL isRunning;
- }
- - (NSString *)documentRoot;
- - (void)setDocumentRoot:(NSString *)value;
- - (Class)connectionClass;
- - (void)setConnectionClass:(Class)value;
- - (NSString *)interface;
- - (void)setInterface:(NSString *)value;
- - (UInt16)port;
- - (UInt16)listeningPort;
- - (void)setPort:(UInt16)value;
- - (NSString *)domain;
- - (void)setDomain:(NSString *)value;
- - (NSString *)name;
- - (NSString *)publishedName;
- - (void)setName:(NSString *)value;
- - (NSString *)type;
- - (void)setType:(NSString *)value;
- - (void)republishBonjour;
- - (NSDictionary *)TXTRecordDictionary;
- - (void)setTXTRecordDictionary:(NSDictionary *)dict;
- - (BOOL)start:(NSError **)errPtr;
- - (void)stop;
- - (void)stop:(BOOL)keepExistingConnections;
- - (BOOL)isRunning;
- - (void)addWebSocket:(WebSocket *)ws;
- - (NSUInteger)numberOfHTTPConnections;
- - (NSUInteger)numberOfWebSocketConnections;
- @end
|