Skip to content

KiteTicker connection drop is not detected due to non-functional ping loop (_loop_ping does not send pings) #237

Open

Description

@gvrcreddy

In kiteconnect/ticker.py, the _loop_ping method is scheduled during onOpen to maintain connection health. However, the method only updates _last_ping_time and schedules the next call; it never actually transmits a ping frame (self.sendPing() is never called).

Because of this, self._last_pong_time remains None indefinitely, rendering the _loop_pong_check connection drop detector inactive. In the event of a silent network drop (e.g., losing internet/WiFi without a TCP reset), the socket remains in a "ghost" connected state until the OS TCP keepalive timeout (which defaults to 2 hours on macOS) kills it.

Activity

  1. AnkitaAdvitot commented on Sep 17, 2026

    @AnkitaAdvitot

    I have submitted a fix for this in #245 with full unit test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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