Documentation ¶
Index ¶
- type Client
- func NewClient(host string, port uint16, handler connection.Handler, ...) *Client
- func NewTcpClient(host string, port uint16, handler connection.Handler) *Client
- func NewTlsClient(host string, port uint16, handle connection.Handler, caCert []byte, ...) *Client
- func NewUdpClient(host string, port uint16, handler connection.Handler) *Client
- func NewUnixClient(path string, port uint16, handler connection.Handler) *Client
- type Server
- func NewServer(host string, port uint16, handler connection.Handler, ...) *Server
- func NewTcpServer(host string, port uint16, handler connection.Handler) *Server
- func NewTlsServer(host string, port uint16, handle connection.Handler, certificate []byte, ...) *Server
- func NewUdpServer(host string, port uint16, handler connection.Handler) *Server
- func NewUnixServer(host string, port uint16, handler connection.Handler) *Server
- func (s *Server) Broadcast(msg []byte) (err error)
- func (s *Server) ClientIp(id int) (ip string, err error)
- func (s *Server) ListenAndServe() (err error)
- func (s *Server) Send(id int, msg []byte) (err error)
- func (s *Server) Stop()
- func (s *Server) TlsConfig(certificate []byte, privateKey []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(host string, port uint16, handler connection.Handler, protocol connection.Protocol) *Client
func NewTcpClient ¶
func NewTcpClient(host string, port uint16, handler connection.Handler) *Client
func NewTlsClient ¶
func NewUdpClient ¶
func NewUdpClient(host string, port uint16, handler connection.Handler) *Client
func NewUnixClient ¶
func NewUnixClient(path string, port uint16, handler connection.Handler) *Client
func (*Client) Disconnect ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(host string, port uint16, handler connection.Handler, protocol connection.Protocol) *Server
func NewTcpServer ¶
func NewTcpServer(host string, port uint16, handler connection.Handler) *Server
func NewTlsServer ¶
func NewUdpServer ¶
func NewUdpServer(host string, port uint16, handler connection.Handler) *Server
func NewUnixServer ¶
func NewUnixServer(host string, port uint16, handler connection.Handler) *Server
func (*Server) ListenAndServe ¶
Click to show internal directories.
Click to hide internal directories.