LogoLogo
WebsiteTwitterSubstack
  • Nozomi
    • Introduction
    • Transaction Submission
      • Rust
      • Python
      • JavaScript
      • TypeScript
      • CURL
      • Jupiter Swap Example
      • Go
      • Tip Stream
    • Keeping Your TCP Connection Alive
Powered by GitBook
On this page
  • 🔄 How Do I Keep the Connection Alive?
  • Strategy
  • Suggested Interval
  • ⚠️ Notes
Export as PDF
  1. Nozomi

Keeping Your TCP Connection Alive

🔄 How Do I Keep the Connection Alive?

To keep your TCP connection to our server alive and avoid reconnecting, you can periodically send a simple request to the /ping endpoint.


Strategy

The server supports persistent connections with a keep-alive timeout of 65 seconds. This means:

  • If your connection is idle for more than 65 seconds, it will be closed.

  • To keep it open, send any request before that timeout expires.

  • Each connection can send max 1000 requests.

We recommend using the /ping endpoint:

GET /ping

This endpoint is lightweight, fast, and designed specifically to help maintain your connection.


Suggested Interval

Send a request to /ping every 60 seconds to keep the connection alive reliably.

Example:

while true; do
  curl -s http://nozomi.temporal.xyz/ping > /dev/null
  sleep 60
done

⚠️ Notes

  • This is not a health check — it's just a way to prevent idle disconnects

  • Avoid pinging more often than needed

PreviousTip Stream

Last updated 1 month ago