Files
2023-03-09 14:39:57 +08:00

845 B

title, id, slug, sidebar_position
title id slug sidebar_position
Access differences between WebSocket and TCP diff-ws-tcp /socket/diff_ws_tcp 6

LongPort support WebSocket and TCP feed, the differences:

  • Data of TCP is streaming, so coding client is hard than WebSocket.
  • WebSocket using URL Query to Handshake
  • WebSocket using ping-pong to do Heartbeating, instead of sending heartbeat packet.
  • WebSocket using TLS to secure connection, but TCP do not.

User can choice TCP or WebSocket on self demand.

Advice: Using WebSocket first, it is more simple. If want more quick stock quote real-time pushing, using TCP to access stock quote gateway.