Skip to content

Clients connects after timeout #156

Open
@MarcoAzk

Description

Hello, version used 0.3.5
Sometimes my clients are able to connect to a ratchet server (on the same server) also after the timeout defined in the connector (5 seconds):

public function callWSS() {
        $this->commandexecuted = false;
        $loop = \React\EventLoop\Factory::create();
        $reactConnector = new \React\Socket\Connector($loop, [
            'timeout' => 5.0
        ]);

        appDebug($this->servicename, $this->json['transactionId'],'Try to connect to WebSocket Server on "' . $this->wsServerHost);

        $connector = new \Ratchet\Client\Connector($loop, $reactConnector);

        $wsurl = "ws://{$this->wsServerHost}:{$this->wsServerPort}/{$this->wsServerPath}"

        $connector( $wsurl )->then(
        //resolve
            function( \Ratchet\Client\WebSocket $conn) use ($loop) {
                appDebug($this->servicename, $this->json['transactionId'],'Connected successfully to WebSocket Server  on "' . $this->wsServerHost);
            }
        );
        $loop->run();
    }

This is an sample of the log i got with 25 seconds after calling connection
[2024-09-02 21:30:07] production.DEBUG: | 5a2b765f-48c0-4d81-8c4a-e66b615f8450 | Try to connect to WebSocket Server on "127.0.0.1
[2024-09-02 21:30:32] production.DEBUG: | 5a2b765f-48c0-4d81-8c4a-e66b615f8450 | Connected successfully to WebSocket Server on "127.0.0.1

Am i faulting somewhere?

Thanks
Marco

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions