This repository was archived by the owner on May 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-13
lines changed Expand file tree Collapse file tree 1 file changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -17,24 +17,23 @@ @implementation ViewController
17
17
- (void ) viewDidLoad
18
18
{
19
19
[super viewDidLoad ];
20
- // Do any additional setup after loading the view, typically from a nib.
21
20
21
+ // create socket.io client instance
22
22
socketIO = [[SocketIO alloc ] initWithDelegate: self ];
23
- // socketIO.useSecure = YES;
23
+
24
+ // you can update the resource name of the handshake URL
25
+ // see https://github.com/pkyeck/socket.IO-objc/pull/80
26
+ // [socketIO setResourceName:@"whatever"];
27
+
28
+ // if you want to use https instead of http
29
+ // socketIO.useSecure = YES;
30
+
31
+ // connect to the socket.io server that is running locally at port 3000
24
32
[socketIO connectToHost: @" localhost" onPort: 3000 ];
25
33
}
26
34
27
- - (void ) viewDidUnload
28
- {
29
- [super viewDidUnload ];
30
- // Release any retained subviews of the main view.
31
- }
32
-
33
- - (BOOL ) shouldAutorotateToInterfaceOrientation : (UIInterfaceOrientation)interfaceOrientation
34
- {
35
- return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
36
- }
37
-
35
+ # pragma mark -
36
+ # pragma mark socket.IO-objc delegate methods
38
37
39
38
- (void ) socketIODidConnect : (SocketIO *)socket
40
39
{
@@ -67,6 +66,17 @@ - (void) socketIODidDisconnect:(SocketIO *)socket disconnectedWithError:(NSError
67
66
NSLog (@" socket.io disconnected. did error occur? %@ " , error);
68
67
}
69
68
69
+ # pragma mark -
70
+
71
+ - (void ) viewDidUnload
72
+ {
73
+ [super viewDidUnload ];
74
+ }
75
+
76
+ - (BOOL ) shouldAutorotateToInterfaceOrientation : (UIInterfaceOrientation)interfaceOrientation
77
+ {
78
+ return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
79
+ }
70
80
71
81
72
82
@end
You can’t perform that action at this time.
0 commit comments