Skip to content

Commit cb3af02

Browse files
author
Martijn Croonen
committed
Small fix for CONNECTING state change
1 parent d5ec350 commit cb3af02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

App/Net/WebSocketServer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function accept() {
137137
$aRemoteHost = explode(':', stream_socket_get_name($rConnection, true));
138138

139139
/* Check if a connection from this IP is already in the CONNECTING state */
140-
if (isset(WebSocketConnection :: $aInConnectingState[$aRemoteHost[0]]))
140+
if (array_key_exists($aRemoteHost[0], WebSocketConnection :: $aInConnectingState))
141141
{
142142
/* Queue it if so */
143143
$this -> m_aConnectionQueue[] = array('ip' => $aRemoteHost[0], 'conn' => $rConnection);
@@ -155,7 +155,7 @@ public function accept() {
155155
foreach ($this -> m_aConnectionQueue as $sKey => &$aConnection)
156156
{
157157
/* If the previous connection from this client is no longer CONNECTING */
158-
if (!isset(WebSocketConnection :: $aInConnectingState[$aConnection['ip']]))
158+
if (!array_key_exists($aConnection['ip'], WebSocketConnection :: $aInConnectingState))
159159
{
160160
$rConnection = $aConnection['conn'];
161161
WebSocketConnection :: $aInConnectingState[$aConnection['ip']] = true;

0 commit comments

Comments
 (0)