c2s_connwasm

package
v0.0.0-...-58ce3ea Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayBufferToSlice

func ArrayBufferToSlice(value js.Value) []byte

func JsLogError

func JsLogError(v ...interface{})

func JsLogErrorf

func JsLogErrorf(format string, v ...interface{})

func Uint8ArrayToSlice

func Uint8ArrayToSlice(value js.Value) []byte

Types

type Connection

type Connection struct {
	SendRecvStop func()
	// contains filtered or unexported fields
}

func New

func New(
	connAddr string,
	marshalBodyFn func(interface{}, []byte) ([]byte, byte, error),
	handleRecvPacketFn func(header c2s_packet.Header, body []byte) error,
	handleSentPacketFn func(pk *c2s_packet.Packet) error,
) *Connection

func (*Connection) Connect

func (wsc *Connection) Connect(ctx context.Context, wg *sync.WaitGroup) error

func (*Connection) EnqueueSendPacket

func (wsc *Connection) EnqueueSendPacket(pk *c2s_packet.Packet) error

func (*Connection) String

func (wsc *Connection) String() string

Jump to

Keyboard shortcuts

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