Documentation ¶
Index ¶
- Variables
- type Mux
- type Stream
- func (s *Stream) Close() error
- func (s *Stream) LocalAddr() net.Addr
- func (s *Stream) Read(p []byte) (int, error)
- func (s *Stream) RemoteAddr() net.Addr
- func (s *Stream) SetDeadline(t time.Time) error
- func (s *Stream) SetReadDeadline(t time.Time) error
- func (s *Stream) SetWriteDeadline(t time.Time) error
- func (s *Stream) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrClosedConn = errors.New("underlying connection was closed") ErrClosedStream = errors.New("stream was gracefully closed") ErrPeerClosedStream = errors.New("peer closed stream gracefully") ErrPeerClosedConn = errors.New("peer closed underlying connection") )
Errors relating to stream or mux shutdown.
Functions ¶
This section is empty.
Types ¶
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
A Mux multiplexes multiple duplex Streams onto a single net.Conn.
func (*Mux) AcceptStream ¶
AcceptStream waits for and returns the next peer-initiated Stream.
func (*Mux) DialStream ¶
DialStream creates a new Stream.
Unlike e.g. net.Dial, this does not perform any I/O; the peer will not be aware of the new Stream until Write is called.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
A Stream is a duplex connection multiplexed over a net.Conn. It implements the net.Conn interface.
func (*Stream) RemoteAddr ¶
RemoteAddr returns the underlying connection's RemoteAddr.
func (*Stream) SetDeadline ¶
SetDeadline sets the read and write deadlines associated with the Stream. It is equivalent to calling both SetReadDeadline and SetWriteDeadline.
This implementation does not entirely conform to the net.Conn interface: setting a new deadline does not affect pending Read or Write calls, only future calls.
func (*Stream) SetReadDeadline ¶
SetReadDeadline sets the read deadline associated with the Stream.
This implementation does not entirely conform to the net.Conn interface: setting a new deadline does not affect pending Read calls, only future calls.
func (*Stream) SetWriteDeadline ¶
SetWriteDeadline sets the write deadline associated with the Stream.
This implementation does not entirely conform to the net.Conn interface: setting a new deadline does not affect pending Write calls, only future calls.