00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 #import <Foundation/Foundation.h>
00010 
00011 
00012 typedef NSArray SIOParameterArray;
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 @interface SIOSocket : NSObject
00023 
00024 
00025 + (void)socketWithHost:(NSString *)hostURL response:(void(^)(SIOSocket *socket))response;
00026 + (void)socketWithHost:(NSString *)hostURL reconnectAutomatically:(BOOL)reconnectAutomatically attemptLimit:(NSInteger)attempts withDelay:(NSTimeInterval)reconnectionDelay maximumDelay:(NSTimeInterval)maximumDelay timeout:(NSTimeInterval)timeout response:(void(^)(SIOSocket *socket))response;
00027 + (void)socketWithHost:(NSString *)hostURL reconnectAutomatically:(BOOL)reconnectAutomatically attemptLimit:(NSInteger)attempts withDelay:(NSTimeInterval)reconnectionDelay maximumDelay:(NSTimeInterval)maximumDelay timeout:(NSTimeInterval)timeout withTransports:(NSArray *)transports response:(void(^)(SIOSocket *socket))response;
00028 
00029 
00030 @property (nonatomic, copy) void (^onConnect)();
00031 @property (nonatomic, copy) void (^onConnectError)(NSDictionary *errorInfo);
00032 @property (nonatomic, copy) void (^onDisconnect)();
00033 @property (nonatomic, copy) void (^onError)(NSDictionary *errorInfo);
00034 
00035 @property (nonatomic, copy) void (^onReconnect)(NSInteger numberOfAttempts);
00036 @property (nonatomic, copy) void (^onReconnectionAttempt)(NSInteger numberOfAttempts);
00037 @property (nonatomic, copy) void (^onReconnectionError)(NSDictionary *errorInfo);
00038 
00039 - (void)on:(NSString *)event callback:(void (^)(SIOParameterArray *args))function;
00040 
00041 
00042 - (void)emit:(NSString *)event;
00043 - (void)emit:(NSString *)event args:(SIOParameterArray *)args;
00044 
00045 - (void)close;
00046 
00047 @end