700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
|
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
|
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
exception = [OFConnectionFailedException
exceptionWithHost: nil
port: 0
socket: object
errNo: errNo];
if ([_delegate respondsToSelector:
@selector(of_socketDidConnect:exception:)])
[_delegate of_socketDidConnect: object
exception: exception];
@selector(of_socketDidConnect:exception:)]) {
/*
* Make sure we only call the delegate once we removed the
* socket from the kernel event observer. This is necessary as
* otherwise we could try to connect to the next address and it
* would not be re-registered with the kernel event observer,
* which is necessary for some kernel event observers (e.g.
* epoll) even if the fd of the new socket is the same.
*/
OFRunLoop *runLoop = [OFRunLoop currentRunLoop];
OFTimer *timer = [OFTimer
timerWithTimeInterval: 0
target: _delegate
selector: @selector(of_socketDidConnect:
exception:)
object: object
object: exception
repeats: false];
[runLoop addTimer: timer
forMode: runLoop.currentMode];
}
return false;
}
@end
# endif
@implementation OFRunLoopAcceptQueueItem
|