FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixbug: handshake error · linuxgnu/framework@b078d14 · GitHub

Repository navigation

Commit b078d14

Browse files
committed
Fixbug: handshake error
1 parent dfa46d3 commit b078d14

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎examples/websocket_server.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function onMessage($client_id, $ws)
1717
Swoole\Error::$echo_html = false;
1818

1919
$AppSvr = new WebSocket();
20-
$AppSvr->loadSetting("./swoole.ini"); //加载配置文件
20+
$AppSvr->loadSetting(__DIR__."/swoole.ini"); //加载配置文件
2121
$AppSvr->setLogger(new \Swoole\Log\EchoLog(true)); //Logger
2222

2323
/**

‎libs/Swoole/Network/Protocol/WebSocket.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,12 @@ function opcodeSwitch($client_id, $ws)
349349
}
350350
function onConnect($serv, $client_id, $from_id)
351351
{
352-
// $this->log("connected client_id = $client_id");
352+
$this->log("connected client_id = $client_id");
353353
}
354354
function onClose($serv, $client_id, $from_id)
355355
{
356-
// $this->log("close client_id = $client_id");
357-
unset($this->ws_list[$client_id], $this->connections[$client_id]);
356+
$this->log("close client_id = $client_id");
357+
unset($this->ws_list[$client_id], $this->connections[$client_id], $this->requests[$client_id]);
358358
}
359359
/**
360360
* Close a connection.

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL