Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit a49edf4

Browse files
committed
update example code to also include the new setResourceName: method
1 parent 512c2dc commit a49edf4

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

SocketTesterARC/ViewController.m

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,23 @@ @implementation ViewController
1717
- (void) viewDidLoad
1818
{
1919
[super viewDidLoad];
20-
// Do any additional setup after loading the view, typically from a nib.
2120

21+
// create socket.io client instance
2222
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
2432
[socketIO connectToHost:@"localhost" onPort:3000];
2533
}
2634

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
3837

3938
- (void) socketIODidConnect:(SocketIO *)socket
4039
{
@@ -67,6 +66,17 @@ - (void) socketIODidDisconnect:(SocketIO *)socket disconnectedWithError:(NSError
6766
NSLog(@"socket.io disconnected. did error occur? %@", error);
6867
}
6968

69+
# pragma mark -
70+
71+
- (void) viewDidUnload
72+
{
73+
[super viewDidUnload];
74+
}
75+
76+
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
77+
{
78+
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
79+
}
7080

7181

7282
@end

0 commit comments

Comments
 (0)