Skip to content

Instantly share code, notes, and snippets.

@martinomburajr
Last active May 29, 2019 04:22
Show Gist options
  • Save martinomburajr/3829f772f3a6c482c2a4077ec776ada0 to your computer and use it in GitHub Desktop.
Save martinomburajr/3829f772f3a6c482c2a4077ec776ada0 to your computer and use it in GitHub Desktop.
net.conn struct
// net.conn struct file: net/net.go l:164
type conn struct {
fd *netFD
}
func (c *conn) ok() bool { return c != nil && c.fd != nil }
// Implementation of the Conn interface.
// Read implements the Conn Read method.
func (c *conn) Read(b []byte) (int, error) {}
// Write implements the Conn Write method.
func (c *conn) Write(b []byte) (int, error) {}
// Close closes the connection.
func (c *conn) Close() error {}
// LocalAddr returns the local network address.
func (c *conn) LocalAddr() Addr {}
// RemoteAddr returns the remote network address.
func (c *conn) RemoteAddr() Addr {}
// SetDeadline implements the Conn SetDeadline method.
func (c *conn) SetDeadline(t time.Time) error {}
// SetReadDeadline implements the Conn SetReadDeadline method.
func (c *conn) SetReadDeadline(t time.Time) error {}
// SetWriteDeadline implements the Conn SetWriteDeadline method.
func (c *conn) SetWriteDeadline(t time.Time) error {}
// SetReadBuffer sets the size of the operating system's receive buffer associated with the connection.
func (c *conn) SetReadBuffer(bytes int) error {}
// SetWriteBuffer sets the size of the operating system's transmit buffer associated with the connection.
func (c *conn) SetWriteBuffer(bytes int) error {}
// File returns a copy of the underlying os.File
func (c *conn) File() (f *os.File, err error) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment