Coder Social home page Coder Social logo

Comments (3)

necryin avatar necryin commented on August 16, 2024 1

php sdk использует под капотом https://github.com/Textalk/websocket-php , которая не шлет pong на ping от сервера. Сервер streaming не получив pong-ов на свои сообщения закрывает соединение. Textalk/websocket-php#24 так и не вмерджили :)

from invest-openapi.

ayurushev avatar ayurushev commented on August 16, 2024

Путем отладки удалось выяснить, что API Streaming просто перестает что либо присылать через 15-20 сек, следовательно, в PHP (WebSocket) получаю exception:

WebSocket\ConnectionException: Empty read; connection dead? Stream state: {"crypto":{"protocol":"UNKNOWN","cipher_name":"TLS_AES_256_GCM_SHA384","cipher_bits":256,"cipher_version":"TLSv1.3"},"timed_out":false,"blocked":true,"eof":true,"stream_type":"tcp_socket\/ssl","mode":"r+","unread_bytes":0,"seekable":false} in /var/www/default/html/tib/vendor/textalk/websocket/lib/Base.php:269 Stack trace: #0 /var/www/default/html/tib/vendor/textalk/websocket/lib/Base.php(143): WebSocket\Base->read(2) #1 /var/www/default/html/tib/vendor/textalk/websocket/lib/Base.php(135): WebSocket\Base->receive_fragment() #2 /var/www/default/html/tib/vendor/james.rus52/tinkoffinvest/src/TIClient.php(617): WebSocket\Base->receive()

По tcpdump вижу, что прилетает RST пакет

15:07:03.798375 IP 178.248.239.55.https > ipXXXXX.34970: Flags [R], seq 242887342, win 0, length 0
15:07:03.798386 IP 178.248.239.55.https > ipXXXXX.34970: Flags [R], seq 242887342, win 0, length 0

from invest-openapi.

ayurushev avatar ayurushev commented on August 16, 2024

php sdk использует под капотом https://github.com/Textalk/websocket-php , которая не шлет pong на ping от сервера. Сервер streaming не получив pong-ов на свои сообщения закрывает соединение. Textalk/websocket-php#24 так и не вмерджили :)

Благодарю! Добавил в lib/Base.php

if ($opcode === 'ping') {
      $this->send('pong', 'pong', true);
    }

заработало:)

from invest-openapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.