Half-open connection (stale socket)

A half-open connection is a network session that one side still believes is open while the other side, or the path between them, has stopped delivering. No close message and no error arrive; the application keeps waiting for data that will never come, and a trading screen shows a market that looks calm when the feed is actually dead.

Senzoukria · Glossary · Updated September 2026


Definition

A TCP or WebSocket connection is closed properly only when a close is exchanged. If a router, a Wi-Fi hop, a VPN or the far server fails abruptly, that exchange never happens. The local socket stays open, reads simply block, and no error is raised until something forces traffic through the dead path.

Why it is dangerous in trading

  • A frozen price and an empty tape look like a quiet market, the most reassuring image the screen can show.
  • Positions and working orders may no longer be updated, so the display stops reflecting the account.
  • The connection badge can still read connected, because nothing has told it otherwise.

Detection

The only reliable signals are time-based: heartbeats that must arrive at an interval, and watchdogs that note how long it has been since any frame arrived. Worked example: the last frame arrived at 14:02:10 and the watchdog threshold is 5 minutes; the first warning can be raised at 14:07:10, then repeated at most once a minute. A quiet market does not explain five minutes without even a server ping.

In Senzoukria

The ticker plant, which carries market data, has frame-staleness detection. For the PnL and order plants, a watchdog records every received frame, including server pings, and logs a warning when the reader claims to be alive but nothing has arrived for five minutes. By design it only logs: wiring it into the session's health would trigger order-plant re-logins on any false positive, and some prop-firm systems refuse concurrent logins. The connection diagnostic addresses the same trap from the other side: when every step was accepted but no tick arrives, it says so explicitly rather than showing a normal chart.

Common mistakes

  • Trusting a connected badge over the timestamp of the last trade.
  • Waiting for an error message that a half-open socket never produces.
  • Reconnecting automatically on every silence, which can collide with single-session login rules.

In the same section

This page in other languages

Frequently asked questions

How can I tell a dead feed from a quiet market?
Look at time rather than price: when the last trade and the last update arrived, whether other instruments on the same feed are moving, and whether the market is scheduled to be open. A market that is open and liquid does not stay silent for minutes.
Why not reconnect automatically as soon as data stops?
Because silence has several causes, including halts and closed sessions, and some providers allow only one session per login. Blind reconnection can end a working session or be refused, which is why detection and action are kept separate.

Keep reading