FAQ
I was looking to develop a KeepAlive mechanism but net.TCPConn already
has keepAlive so I'm wondering why websocket is using net.Conn instead of
net.TCPConn
[0] https://godoc.org/golang.org/x/net/websocket

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

  • James Bardin at Aug 13, 2015 at 7:08 pm

    On Thursday, August 13, 2015 at 2:43:48 PM UTC-4, ant...@indb.uk wrote:
    I was looking to develop a KeepAlive mechanism but net.TCPConn already
    has keepAlive so I'm wondering why websocket is using net.Conn instead of
    net.TCPConn
    [0] https://godoc.org/golang.org/x/net/websocket
    A net.Conn is an interface, which could be fulfilled via socket-like
    implementation. A net.TCPConn is a struct that represents an actual tcp
    connection. Fundamentally, a websocket itself can't be tcp connection, it's
    at a much higher layer, and only happens to use a tcp connection as its
    transport.

      Also, keepalive on a tcp socket isn't implemented in Go; it's handled by
    the underlying tcp stack on the OS.

    --
    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
postedAug 13, '15 at 6:43p
activeAug 13, '15 at 7:08p
posts2
users2
websitegolang.org

2 users in discussion

Anthony: 1 post James Bardin: 1 post

People

Translate

site design / logo © 2021 Grokbase