Accept() can return an "i/o timeout" (os.ErrDeadlineExceeded) if your 
listener has set a deadline via SetDeadline() 
(e.g. https://pkg.go.dev/net#TCPListener.SetDeadline for a TCP listener)

On Wednesday, 25 October 2023 at 10:00:11 UTC-7 whileloop wrote:

> Hi community,
>
> I am quite stumped by this error that I am getting intermittently on my Go 
> server running on Ubuntu.
>
> The following code logs the error:
> conn, err := listener.Accept()
> if err != nil {
> log.Error(err)
> }
>
> Output:
> accept tcp [::]:42796: i/o timeout
>
> I have never seen an i/o timeout on accept before and I don't know what it 
> could mean. Is this being caused by a resource constraint on my server or 
> is it because the client is not sending data?
>
> Thanks,
> whileloop
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0c58f021-5eb6-4a61-a679-9b2206694d99n%40googlegroups.com.

Reply via email to