On Oct 1, 2018, at 4:59 PM, Ian Lance Taylor <ia...@golang.org> wrote:On Mon, Oct 1, 2018 at 1:53 PM, robert engels <ren...@ix.netcom.com> wrote:
If you go to the TCPConn SetReadDeadline function, it states “implements the Conn SetReadDeadline method”, with no way of referencing the documentation for Conn.SetReadDeadline, in fact, no way of even getting to the Conn interface… who knows what Conn is ??? Assume it is a Conn returned by Dial? How do you determine this?
You're right, that is kind of useless. Would you mind filing an issue
about that? It should be fixed one way or another.
Furthermore, it is not completely specified, meaning if the read timeout occurs, and some data was read, is it discarded? will it be returned with the next read (if any)? Doesn’t say...
The behavior of the standard Read method when an error occurs is
documented by the io.Reader interface.
UDPConn is the implementation of the Conn and PacketConn interfaces for UDP network connections.
type UDPConn struct {
// contains filtered or unexported fields
}// Read reads data from the connection.
// Read can be made to time out and return an Error with Timeout() == true
// after a fixed time limit; see SetDeadline and SetReadDeadline.
Read(b []byte) (n int, err error)
Maybe I am looking at it wrong, but I think Go’s “simplicity” cannot be extended to the specifications, especially when dealing with low-level networking, api, etc. It makes it very difficult to use, and be able to guarantee it will work the same on all platforms - hurting the portability.
I'm not really sure what you're thinking of here.
Ian
On Oct 1, 2018, at 4:59 PM, Ian Lance Taylor <ia...@golang.org> wrote:On Mon, Oct 1, 2018 at 1:53 PM, robert engels <ren...@ix.netcom.com> wrote:
If you go to the TCPConn SetReadDeadline function, it states “implements the Conn SetReadDeadline method”, with no way of referencing the documentation for Conn.SetReadDeadline, in fact, no way of even getting to the Conn interface… who knows what Conn is ??? Assume it is a Conn returned by Dial? How do you determine this?
You're right, that is kind of useless. Would you mind filing an issue
about that? It should be fixed one way or another.I will do so.