websocket

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func NewConnection

func NewConnection(conn *websocket.Conn, errChan chan error) *Connection

func Upgrade

func Upgrade(ctx *gin.Context, errChan chan error) (success bool, connection *Connection)

Upgrade 将HTTP连接升级为Websocket连接

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) Read

func (c *Connection) Read() <-chan []byte

func (*Connection) Serve

func (c *Connection) Serve()

Serve 启动WebsocketConnection的服务协程

func (*Connection) Write

func (c *Connection) Write(jsonBytes []byte)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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