forked from francoisTemasys/socket.IO-objc
-
Notifications
You must be signed in to change notification settings - Fork 24
/
SocketIOTransport.h
55 lines (44 loc) · 1.22 KB
/
SocketIOTransport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// SocketIOTransport.h
// v0.5.1
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
// by Fred Potter <[email protected]>
//
// using
// https://github.com/square/SocketRocket
//
// reusing some parts of
// /socket.io/socket.io.js
//
// Created by Philipp Kyeck http://beta-interactive.de
//
// With help from
// https://github.com/pkyeck/socket.IO-objc/blob/master/CONTRIBUTORS.md
//
#import <Foundation/Foundation.h>
typedef enum SocketIOVersion
{
V09x,
V10x
} SocketIOVersion;
@protocol SocketIOTransportDelegate <NSObject>
- (void) onData:(id)message;
- (void) onDisconnect:(NSError*)error;
- (void) onError:(NSError*)error;
@property (nonatomic, readonly) NSString *host;
@property (nonatomic, readonly) NSInteger port;
@property (nonatomic, readonly) NSString *sid;
@property (nonatomic, readonly) NSTimeInterval heartbeatTimeout;
@property (nonatomic) BOOL useSecure;
@end
@protocol SocketIOTransport <NSObject>
- (id) initWithDelegate:(id <SocketIOTransportDelegate>)delegate;
- (void) open;
- (void) openUsing:(SocketIOVersion)version;
- (void) close;
- (BOOL) isReady;
- (void) send:(NSString *)request;
@property (nonatomic, weak) id <SocketIOTransportDelegate> delegate;
@end