wsocket

package module
v0.0.0-...-41d7d3e Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadBufferSize  = 4096
	WriteBufferSize = 4096
)

Variables

This section is empty.

Functions

func BinarySend

func BinarySend(buffer bytes.Buffer, conn net.Conn)

func PingSend

func PingSend(buffer bytes.Buffer, conn net.Conn)

func PongSend

func PongSend(buffer bytes.Buffer, conn net.Conn)

func Send

func Send(opcode ws.OpCode, buffer bytes.Buffer, conn net.Conn)

func TextSend

func TextSend(text string, conn net.Conn)

Types

type WsHandler

type WsHandler struct {
	PreHandler    func(buffer *bytes.Buffer)
	BinaryHandler func(buffer bytes.Buffer, conn net.Conn)
	TextHandler   func(text string, conn net.Conn)
	PongHandler   func(buffer bytes.Buffer, conn net.Conn)
	PingHandler   func(buffer bytes.Buffer, conn net.Conn)
}

type Wserver

type Wserver struct {
	Ug ws.Upgrader
	// contains filtered or unexported fields
}

func Init

func Init(workers int, maxTask int, addr string, handler handlerInterface) *Wserver

func (*Wserver) SetHandlerImpl

func (w *Wserver) SetHandlerImpl(handler handlerInterface)

func (*Wserver) Start

func (w *Wserver) Start() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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