impl

package
v0.0.0-...-3fc60fe Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 3 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
}

SendMessage 将消息投递到out channel ReadMessage 从 in channel 读取消息 起两个协程

读协程,循环读取websocket,将消息投递到in channel
写协程,循环读取 out channel,将消息写回 websocket

func InitConnection

func InitConnection(wsConn *websocket.Conn) (conn *Connection, err error)

init

func (*Connection) Close

func (conn *Connection) Close()

关闭

func (*Connection) ReadMessage

func (conn *Connection) ReadMessage() (data []byte, err error)

读消息

func (*Connection) WriteMessage

func (conn *Connection) WriteMessage(data []byte) (err error)

写消息

Jump to

Keyboard shortcuts

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