Documentation
¶
Index ¶
- type Client
- func (c *Client[T]) Close() error
- func (c *Client[T]) Conn() Conn
- func (c *Client[T]) Connect()
- func (c *Client[T]) GetDailTimeout() time.Duration
- func (c *Client[T]) GetRouter() *router.Router[*socket.Stream[Conn], T]
- func (c *Client[T]) LocalAddr() net.Addr
- func (c *Client[T]) RemoteAddr() net.Addr
- func (c *Client[T]) Sender() socket.Emitter[Conn]
- func (c *Client[T]) SetRouter(router *router.Router[*socket.Stream[Conn], T]) *Client[T]
- func (c *Client[T]) Use(middle ...func(Middle) Middle)
- type Conn
- type Middle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client[T any] struct { Name string Addr string // TLS FILE CertFile string // TLS KEY KeyFile string // TLS TLSConfig *tls.Config Response *http.Response Header http.Header HeartBeatTimeout time.Duration HeartBeatInterval time.Duration ReconnectInterval time.Duration HeartBeat func(conn Conn) error WriteBufferSize int ReadBufferSize int DailTimeout time.Duration SubProtocols []string OnOpen func(conn Conn) OnClose func(conn Conn) OnMessage func(conn Conn, messageType int, msg []byte) OnError func(stream *socket.Stream[Conn], err error) OnException func(err error) OnSuccess func() OnReconnecting func() OnUnknown func(conn Conn, message []byte, next Middle) PingHandler func(conn Conn) func(data string) error PongHandler func(conn Conn) func(data string) error Protocol protocol.Protocol // contains filtered or unexported fields }
func (*Client[T]) GetDailTimeout ¶
func (*Client[T]) RemoteAddr ¶
type Conn ¶
type Conn interface {
Name() string
SetName(name string)
LocalAddr() net.Addr
RemoteAddr() net.Addr
Close() error
Write(messageType int, data []byte) (int, error)
Read() (int, []byte, error)
LastPong() time.Time
SetLastPong(t time.Time)
Ping() error
Pong() error
Conn() *websocket.Conn
SubProtocols() []string
SetDeadline(t time.Time) error
socket.Packer
}
Click to show internal directories.
Click to hide internal directories.