Documentation
¶
Index ¶
- Variables
- type Conn
- func (c *Conn) Close()
- func (c *Conn) Dial(network, addr string) error
- func (c *Conn) DialContext(ctx context.Context, network, addr string) error
- func (c *Conn) ReadMessage() (interface{}, error)
- func (c *Conn) ReadWithDeadline(deadLine time.Time) (interface{}, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SendMessage(m interface{}) error
- type ConnOption
- type Transport
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTransport = Transport{ DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, DualStack: true, }).DialContext, }
DefaultTransport implements the default dialing strategy
View Source
var ErrUnknownMessage = errors.New("unknown message")
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
Transport *Transport
// contains filtered or unexported fields
}
Conn is a connection between two waves nodes
func (*Conn) DialContext ¶
DialContext dials a remote andpoint
func (*Conn) ReadMessage ¶ added in v0.2.0
func (*Conn) ReadWithDeadline ¶ added in v0.2.0
ReadWithDeadline reads a message with a deadline
func (*Conn) RemoteAddr ¶ added in v0.2.0
func (*Conn) SendMessage ¶ added in v0.2.0
type ConnOption ¶
ConnOption is a connection creation option
func WithContext ¶ added in v0.2.0
func WithContext(ctx context.Context) ConnOption
WithContext is an option to add a context to the connection
func WithNetConn ¶ added in v0.2.0
func WithNetConn(conn net.Conn) ConnOption
func WithRemote ¶
func WithRemote(network, addr string) ConnOption
WithRemote is an option for remote endpoint
func WithTransport ¶
func WithTransport(t *Transport) ConnOption
WithTransport is an option for custom transport of the connection
Click to show internal directories.
Click to hide internal directories.