How to ensure or keep socket alive?
-
Well this is a really open question here "How to ensure or keep socket alive?" I'm afraid that I have to say "sorry" for this open question. But I still wanna ask some ideas. How to provide an end-to-end solution for application, which make application know that both ends works with limited resource? Any solution or suggestion is well appreciated here.
-
Answer:
I assume you mean a TCP socket. You can't guarantee that it's alive at any given time. If enabling SO_KEEPALIVE does not do what you want, you'll need to do custom keepalive packets within the application protocol. Some protocols, for isntance, have a "NOOP" command which can be used. Under Linux (but not necessarily other OSs) you can modify the keepalive interval used by SO_KEEPALIVE on a per-socket basis (see man 7 tcp)
Daniel at Stack Overflow Visit the source
Related Q & A:
- how to keep icons in listview in android?Best solution by Stack Overflow
- How to create socket connection with php?Best solution by Stack Overflow
- How to know if you have dry socket?Best solution by Yahoo! Answers
- What to do to keep cut sunflowers alive?Best solution by Yahoo! Answers
- How much would it cost to replace the jack socket on my fender bass?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.