Skip to content

Commit 07fea3a

Browse files
committed
Revert : Improved error catching in WsServer
This reverts commit c08df1f.
1 parent c08df1f commit 07fea3a

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

src/Network/Websocket/WsServer.php

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,13 @@ public function handleMessage(NetworkConnectionInterface $conn, NetworkMessageIn
135135
return;
136136
}
137137

138-
if ($conn->WebSocket->established === false)
138+
if ($conn->WebSocket->established === true)
139139
{
140-
return $this->attemptUpgrade($conn);
141-
}
142-
143-
try
144-
{
145-
return $conn->WebSocket->version->wsMessage($this->connCollection[$conn], $message);
140+
$conn->WebSocket->version->wsMessage($this->connCollection[$conn], $message);
141+
return;
146142
}
147-
catch (Error $ex)
148-
{}
149-
catch (Exception $ex)
150-
{}
151143

152-
$this->handleError($conn, $ex);
144+
$this->attemptUpgrade($conn);
153145
}
154146

155147
/**
@@ -164,7 +156,7 @@ public function handleError(NetworkConnectionInterface $conn, $ex)
164156
}
165157
else
166158
{
167-
$this->close($conn, 500);
159+
$conn->close();
168160
}
169161
}
170162

@@ -209,16 +201,7 @@ protected function attemptUpgrade(NetworkConnectionInterface $conn)
209201

210202
$upgraded->WebSocket->established = true;
211203

212-
try
213-
{
214-
return $this->wsServer->handleConnect($upgraded);
215-
}
216-
catch (Error $ex)
217-
{}
218-
catch (Exception $ex)
219-
{}
220-
221-
$this->close($conn, 500);
204+
$this->wsServer->handleConnect($upgraded);
222205
}
223206

224207
/**

0 commit comments

Comments
 (0)