Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server should be able to gracefully close #3

Open
hongkongkiwi opened this issue Dec 18, 2012 · 1 comment
Open

Server should be able to gracefully close #3

hongkongkiwi opened this issue Dec 18, 2012 · 1 comment

Comments

@hongkongkiwi
Copy link

Needs a close method to stop the server gracefully. If this is not done and the object is just set to nil then the clients continue to stay connected.

I propose something like the following.

// MBWebSocketServer.h
- (void)closeServer;

// MBWebSocketServer.m
- (void)closeServer {
    _port = 0;
    _delegate = nil;
    [socket setDelegate:nil];
    [socket disconnect];
    [connections removeAllObjects];

    NSError *error = nil;
}
@mxcl
Copy link
Owner

mxcl commented Jan 9, 2013

Agreed. PR welcome, or I will get round to this next time I hack on this code. Can't give date for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants