websocket

package
v0.0.0-...-c340371 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 11 Imported by: 3

Documentation

Overview

Package websocket is a websocket implement to transfer

Index

Constants

View Source
const (
	URL_PREFIX = "ws://"
	URL_SUFFIX = "/ws"
)

Variables

View Source
var (
	ERR_WRONG_MESSAGE_TYPE = errors.New("wrong message type")
)

Functions

func NewClient

func NewClient() transfer.IClient

func NewClientWithConnect

func NewClientWithConnect(conn net.Conn) transfer.IClient

func NewConn

func NewConn(conn *websocket.Conn) net.Conn

func NewServer

func NewServer(host string, port int) transfer.IServer

Types

type Conn

type Conn struct {
	*websocket.Conn

	sync.Mutex
	// contains filtered or unexported fields
}

func (*Conn) Read

func (conn *Conn) Read(b []byte) (int, error)

func (*Conn) SetDeadline

func (conn *Conn) SetDeadline(t time.Time) error

func (*Conn) Write

func (conn *Conn) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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