MBWebSocketServer
MBWebSocketServer copied to clipboard
Server should be able to gracefully close
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;
}
Agreed. PR welcome, or I will get round to this next time I hack on this code. Can't give date for that.