Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
kevinkk525

Reliably detect broken internet socket

Question

When using the internet component or internet API I could not find a reliable way to detect a broken socket to an internet adress. Once the connection is broken by the external endpoint, the broken socket can only be detected by writing to the socket, not by reading.

This makes writing a good program very difficult as it would be impractical to send a ping every second just to detect if the socket is still alive.

Is there any possibility I did not see? Or is none implemented?

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

thanks. was worth a try. Sadly this function only works for connecting to a server.
 

but i found the solution: when reading the connected socket you get "" and if the socket is closed then  you get nil.
This way it should be reliable to get the connection status.

Seems like I did not test this enough before.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.