// This object should be constructed on the thread which the streams are
// to be scheduled on. It will hold a weak reference to the run loop on that
// thread.
- NetworkCallbackController(NetworkConnection* connection);
+ explicit NetworkCallbackController(NetworkConnection* connection);
// Creates a socket and schedules it on the current run loop.
void OpenConnection(NSUInteger port);
void NetworkCallbackController::CloseConnection()
{
if (socket_) {
- NSLog(@"invalidating socket %d", close(CFSocketGetNative(socket_)));
CFSocketInvalidate(socket_);
- NSLog(@"socket is valid %d", CFSocketIsValid(socket_));
CFRelease(socket_);
socket_ = NULL;
}
break;
case kCFStreamEventErrorOccurred:
- NSLog(@"%s error", __PRETTY_FUNCTION__);
ReportError(CFReadStreamCopyError(stream));
UnscheduleReadStream();
break;
case kCFStreamEventEndEncountered:
- NSLog(@"%s end", __PRETTY_FUNCTION__);
UnscheduleReadStream();
[connection_ socketDisconnected];
break;