ws

package
v1.1.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package ws wraps websocket implements among UNIX-like(Linux & macOS) platform

Index

Constants

This section is empty.

Variables

View Source
var (
	CommonChanCap = 128
)

Functions

func MkEpoll

func MkEpoll() (*epoll, error)

func SendMsgToClient

func SendMsgToClient(msg []byte, conn net.Conn) error

Types

type Server

type Server struct {
	Path string
	Bind string

	MsgHandler func(*Server, net.Conn, []byte, ws.OpCode) error // server msg handler
	AddCli     func(w http.ResponseWriter, r *http.Request)
	// contains filtered or unexported fields
}

func NewServer

func NewServer(bind, path string) (s *Server, err error)

func (*Server) AddConnection

func (s *Server) AddConnection(conn net.Conn) error

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL