|
|
@@ -288,15 +288,18 @@ class AsyncTcpConnection extends TcpConnection
|
|
|
*/
|
|
|
public function checkConnection()
|
|
|
{
|
|
|
- if ($this->_status != self::STATUS_CONNECTING) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
// Remove EV_EXPECT for windows.
|
|
|
if(DIRECTORY_SEPARATOR === '\\') {
|
|
|
Worker::$globalEvent->del($this->_socket, EventInterface::EV_EXCEPT);
|
|
|
}
|
|
|
|
|
|
+ // Remove write listener.
|
|
|
+ Worker::$globalEvent->del($this->_socket, EventInterface::EV_WRITE);
|
|
|
+
|
|
|
+ if ($this->_status != self::STATUS_CONNECTING) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// Check socket state.
|
|
|
if ($address = stream_socket_get_name($this->_socket, true)) {
|
|
|
// Nonblocking.
|
|
|
@@ -312,9 +315,6 @@ class AsyncTcpConnection extends TcpConnection
|
|
|
socket_set_option($raw_socket, SOL_TCP, TCP_NODELAY, 1);
|
|
|
}
|
|
|
|
|
|
- // Remove write listener.
|
|
|
- Worker::$globalEvent->del($this->_socket, EventInterface::EV_WRITE);
|
|
|
-
|
|
|
// SSL handshake.
|
|
|
if ($this->transport === 'ssl') {
|
|
|
$this->_sslHandshakeCompleted = $this->doSslHandshake($this->_socket);
|