Skip to content

Commit

Permalink
Swoole Handler 使用新的连接时,关闭旧连接
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Jul 19, 2019
1 parent 7c0f9d4 commit 759ec94
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/YurunHttp/Handler/Swoole.php
Expand Up @@ -81,6 +81,10 @@ public function send($request)
if(!$this->handler || $this->handler->host != $host || $this->handler->port != $port || $ssl !== $lastSSL)
{
$lastSSL = $ssl;
if($this->handler)
{
$this->handler->close();
}
$this->handler = new Client($host, $port, $ssl);
$this->handler->setDefer();
}
Expand Down

0 comments on commit 759ec94

Please sign in to comment.