Documentation ¶
Index ¶
- type Conn
- type Middle
- type Server
- func (s *Server[T]) Conn(fd int64) (Conn, error)
- func (s *Server[T]) ConnLen() int
- func (s *Server[T]) GetDailTimeout() time.Duration
- func (s *Server[T]) GetRouter() *router.Router[*socket.Stream[Conn], T]
- func (s *Server[T]) LocalAddr() net.Addr
- func (s *Server[T]) Range(fn func(conn Conn))
- func (s *Server[T]) Ready()
- func (s *Server[T]) Sender(fd int64) (socket.Emitter[Conn], error)
- func (s *Server[T]) SetRouter(router *router.Router[*socket.Stream[Conn], T]) *Server[T]
- func (s *Server[T]) Shutdown() error
- func (s *Server[T]) Start()
- func (s *Server[T]) Use(middle ...func(Middle) Middle)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server[T any] struct { Name string Addr string // TLS FILE CertFile string // TLS KEY KeyFile string // TLS TLSConfig *tls.Config OnClose func(conn Conn) OnMessage func(conn Conn, msg []byte) OnOpen func(conn Conn) OnError func(stream *socket.Stream[Conn], err error) OnException func(err error) OnSuccess func() OnUnknown func(conn Conn, message []byte, next Middle) HeartBeatTimeout time.Duration HeartBeatInterval time.Duration DailTimeout time.Duration ReadBufferSize int WriteBufferSize int 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 (*Server[T]) GetDailTimeout ¶
Click to show internal directories.
Click to hide internal directories.