mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-15 04:35:34 +08:00
add auto-reconnect method to terminal_listener.php
add short name of ZM_BREAKPOINT (BP) fix loop error of syntax happened
This commit is contained in:
@@ -184,6 +184,7 @@ class Console
|
||||
$vss->callback = function(?WSConnection $conn) use ($terminal_id){
|
||||
$req = ctx()->getRequest();
|
||||
if($conn->getType() != "terminal") return false;
|
||||
Console::debug("Terminal fd: ".$conn->fd);
|
||||
if(($req->header["x-terminal-id"] ?? "") != $terminal_id) {
|
||||
$conn->close();
|
||||
return false;
|
||||
@@ -195,6 +196,7 @@ class Console
|
||||
$vss2->type = "message";
|
||||
$vss2->rule = "connectType:terminal";
|
||||
$vss2->callback = function(?WSConnection $conn){
|
||||
if ($conn === null) return false;
|
||||
if($conn->getType() != "terminal") return false;
|
||||
$cmd = ctx()->getFrame()->data;
|
||||
self::executeCommand($cmd);
|
||||
|
||||
Reference in New Issue
Block a user