diff --git a/TcpClient.php b/TcpClient.php index 716299c5700f2d201b7618fc48f5445d94daf3f0..e21aa253dace4bc297b6ba4e2849321337b88c6b 100644 --- a/TcpClient.php +++ b/TcpClient.php @@ -43,7 +43,7 @@ class TcpClient while (true) { $data = fgets(STDIN); //如果用户输入quit,那么退出程序 - if (strcmp($data, "quit") == 0) { + if (strcmp($data, "quit\n") == 0) { break; } socket_write($this->socket_handle, $data);