This commit is contained in:
2021-08-03 14:15:06 +08:00
parent 645fae72ae
commit a16f1004be
4 changed files with 10 additions and 16 deletions
+2 -3
View File
@@ -48,11 +48,10 @@ class HTTPServerListener extends Abstracts\Server
* UDPServerListener constructor. * UDPServerListener constructor.
* @param Server|Port $server * @param Server|Port $server
* @param array|null $settings * @param array|null $settings
* @return Server\Port * @return Server|Port
* @throws ReflectionException
* @throws Exception * @throws Exception
*/ */
public function bindCallback(Server|Port $server, ?array $settings = []): Server\Port public function bindCallback(Server|Port $server, ?array $settings = []): Server|Port
{ {
$this->setEvents(Constant::CONNECT, $settings['events'][Constant::CONNECT] ?? null); $this->setEvents(Constant::CONNECT, $settings['events'][Constant::CONNECT] ?? null);
+2 -2
View File
@@ -25,10 +25,10 @@ class TCPServerListener extends Abstracts\Server
* UDPServerListener constructor. * UDPServerListener constructor.
* @param Server|Port $server * @param Server|Port $server
* @param array|null $settings * @param array|null $settings
* @return Port * @return Server|Port
* @throws Exception * @throws Exception
*/ */
public function bindCallback(Server|Port $server, ?array $settings = []): Port public function bindCallback(Server|Port $server, ?array $settings = []): Server|Port
{ {
$this->setEvents(Constant::CLOSE, $settings['events'][Constant::CLOSE] ?? null); $this->setEvents(Constant::CLOSE, $settings['events'][Constant::CLOSE] ?? null);
$this->setEvents(Constant::RECEIVE, $settings['events'][Constant::RECEIVE] ?? null); $this->setEvents(Constant::RECEIVE, $settings['events'][Constant::RECEIVE] ?? null);
+3 -8
View File
@@ -24,17 +24,12 @@ class UDPServerListener extends Abstracts\Server
/** /**
* @param Server $server * @param Server|Port $server
* @param string $host
* @param int $port
* @param int $mode
* @param array|null $settings * @param array|null $settings
* @return Server\Port * @return Server|Port
* @throws NotFindClassException
* @throws ReflectionException
* @throws Exception * @throws Exception
*/ */
public function bindCallback(Server|Port $server, ?array $settings = []): Server\Port public function bindCallback(Server|Port $server, ?array $settings = []): Server|Port
{ {
$this->setEvents(Constant::PACKET, $settings['events'][Constant::PACKET] ?? null); $this->setEvents(Constant::PACKET, $settings['events'][Constant::PACKET] ?? null);
+3 -3
View File
@@ -28,12 +28,12 @@ class WebSocketServerListener extends Abstracts\Server
/** /**
* @param mixed $server * @param mixed $server
* @param array|null $settings * @param array|null $settings
* @return Server\Port * @return Port|Server
* @throws ReflectionException
* @throws NotFindClassException * @throws NotFindClassException
* @throws ReflectionException
* @throws Exception * @throws Exception
*/ */
public function bindCallback(Server|Port $server, ?array $settings = []): Server\Port public function bindCallback(Server|Port $server, ?array $settings = []): Server|Port
{ {
$this->setEvents(Constant::CONNECT, $settings['events'][Constant::CONNECT] ?? null); $this->setEvents(Constant::CONNECT, $settings['events'][Constant::CONNECT] ?? null);
$this->setEvents(Constant::HANDSHAKE, $settings['events'][Constant::HANDSHAKE] ?? null); $this->setEvents(Constant::HANDSHAKE, $settings['events'][Constant::HANDSHAKE] ?? null);