forked from francoisTemasys/socket.IO-objc
-
Notifications
You must be signed in to change notification settings - Fork 24
/
SocketIOPacket.h
68 lines (57 loc) · 1.58 KB
/
SocketIOPacket.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
56
57
58
59
60
61
62
63
64
65
//
// SocketIOPacket.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>
#import "SocketIOTransport.h"
@class SocketIOPacketV10x;
@interface SocketIOPacket : NSObject
{
NSString *type;
NSString *_separator;
NSString *pId;
NSString *ack;
NSString *name;
NSString *data;
NSArray *args;
NSString *endpoint;
NSArray *_types;
}
@property (nonatomic, copy) NSString *type;
@property (nonatomic, copy) NSString *pId;
@property (nonatomic, copy) NSString *ack;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *data;
@property (nonatomic, copy) NSString *endpoint;
@property (nonatomic, copy) NSArray *args;
- (id) initWithType:(NSString *)packetType;
- (id) initWithTypeIndex:(NSUInteger)index;
- (id) dataAsJSON;
- (NSString *) toString;
- (NSNumber *) typeAsNumber;
- (NSString *) typeForIndex:(NSUInteger)index;
+ (SocketIOPacket *) createPacketWithType:(NSString *)type
version:(SocketIOVersion) version;
+ (SocketIOPacket *) createPacketWithTypeIndex:(NSUInteger) type
version:(SocketIOVersion) version;
@end
@interface SocketIOPacketV10x : SocketIOPacket
{
NSArray *_typesMessage;
}
@end