Skip to content

Commit

Permalink
reconnect added
Browse files Browse the repository at this point in the history
  • Loading branch information
AppWerft committed May 16, 2013
1 parent cf8c886 commit 4546247
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .project
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>TiWs</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>com.appcelerator.titanium.mobile.nature</nature>
<nature>com.appcelerator.titanium.mobile.module.nature</nature>
</natures>
</projectDescription>
13 changes: 12 additions & 1 deletion ios/Classes/NetIamyellowTiwsWSProxy.m
Expand Up @@ -91,11 +91,22 @@ -(void)open:(id)url
WS.delegate = self;
[WS open];
}

- (void)reconnect:(id)url
{
WS.delegate = nil;
[WS close];

WS = [[SRWebSocket alloc] initWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
WS.delegate = self;

[WS open];

}
-(void)close:(id)args
{
if (WS && connected) {
[WS close];
ENSURE_SINGLE_ARG(url, NSString);
}
}

Expand Down

0 comments on commit 4546247

Please sign in to comment.