websocket

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	C_max_write_size = 4096
	C_qw_max_size    = 10000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func CreateServer

func CreateServer() *Server

func (*Server) Accept added in v1.1.1

func (self *Server) Accept(w http.ResponseWriter, req *http.Request) *Server

func (*Server) CheckOrigin

func (self *Server) CheckOrigin(b bool) *Server

func (*Server) Listen

func (self *Server) Listen(addr string) *Server

func (*Server) MapStatic

func (self *Server) MapStatic(url string, dir string) *Server

func (*Server) OnConnection

func (self *Server) OnConnection(f func(sock *Socket)) *Server

func (*Server) OnError

func (self *Server) OnError(f func(err error)) *Server

func (*Server) SetSocketUrl

func (self *Server) SetSocketUrl(url string) *Server

func (*Server) Stop

func (self *Server) Stop()

type Socket

type Socket struct {
	MessageType int
	// contains filtered or unexported fields
}

func (*Socket) Close

func (self *Socket) Close()

func (*Socket) HeartBeat

func (self *Socket) HeartBeat(ms uint32)

func (*Socket) OnClose

func (self *Socket) OnClose(f func())

func (*Socket) OnData

func (self *Socket) OnData(f func(buf []byte))

func (*Socket) RemoteAddr

func (self *Socket) RemoteAddr() string

func (*Socket) RemoteIP

func (self *Socket) RemoteIP() string

func (*Socket) RemotePort

func (self *Socket) RemotePort() int32

func (*Socket) Send

func (self *Socket) Send(buf []byte)

Jump to

Keyboard shortcuts

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