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;
}