FAQ
I am using ReadFrom to read from unix domain socket...
How can i ReadFrom error to detect client dropping connection vs timeout?
There seems to be only 2 methods in that interface:

Timeout() bool // Is the error a timeout?
Temporary() bool // what's that suppose to mean?

--
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

  • Matt Harden at Apr 27, 2015 at 11:42 pm
    Any error for which err.Timeout == false, is not a timeout.
    On Mon, Apr 27, 2015 at 12:16 PM wrote:

    I am using ReadFrom to read from unix domain socket...
    How can i ReadFrom error to detect client dropping connection vs timeout?
    There seems to be only 2 methods in that interface:

    Timeout() bool // Is the error a timeout?
    Temporary() bool // what's that suppose to mean?

    --
    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.
    --
    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.
  • Victor L at Apr 28, 2015 at 3:06 pm
    where is err.Timeout coming from !!?
    n, _, err := c.ReadFrom(rb[0:])
    if err.Timeout == false
    results in compilation error: "err.Timeout is undefined"
    On Mon, Apr 27, 2015 at 7:42 PM, Matt Harden wrote:

    Any error for which err.Timeout == false, is not a timeout.
    On Mon, Apr 27, 2015 at 12:16 PM wrote:

    I am using ReadFrom to read from unix domain socket...
    How can i ReadFrom error to detect client dropping connection vs timeout?
    There seems to be only 2 methods in that interface:

    Timeout() bool // Is the error a timeout?
    Temporary() bool // what's that suppose to mean?

    --
    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.
    --
    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.
  • James Bardin at Apr 28, 2015 at 3:45 pm

    On Tuesday, April 28, 2015 at 11:06:54 AM UTC-4, Victor L wrote:
    where is err.Timeout coming from !!?
    n, _, err := c.ReadFrom(rb[0:])
    You need a type assertion

    if err, ok := err.(net.Error); ok {
         if err.Timeout() == false {
    ... //or similar

    --
    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 27, '15 at 5:16p
activeApr 28, '15 at 3:45p
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase