Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
Javascript - Connect to websocket when possible

In my application, I need to connect to my WebSocket server. The thing is - I don't know when that server is up. It can happen while the application itself is running. So I somehow need to monitor that port until I notice something like "a server is now listening on that port" after that I connect to the server automatically.

I could let the user press a button that tries to connect to the server or I could keep trying to establish a connection using a for loop and a timeout. However, I think that would be a bad solution. Is there a better way?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!