FAQ
Is there a way if you have an open tcp net.Conn with keep alives enabled to
detect that the connection was broken without a c.Read() or c.Write()?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Jesse McNelis at Apr 11, 2016 at 2:22 am

    On 11 Apr 2016 5:48 a.m., wrote:
    Is there a way if you have an open tcp net.Conn with keep alives enabled
    to detect that the connection was broken without a c.Read() or c.Write()?
    >

    There are OS specific ways of doing this, but it's racy as you still end up
    needing to handle the connection breaking before, during or after a
    read/write/close anyway.
    The best way to tell if a connection is usable is to use it. If it's
    unusable then you'll get an error and you can try reconnecting.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jonathan Gaillard at Apr 11, 2016 at 3:03 pm
    Ok will do, thanks

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 10, '16 at 7:48p
activeApr 11, '16 at 3:03p
posts3
users2
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase