transport

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WebsocketURL websocket url
	WebsocketURL = "/websocket/go/x"
)

Variables

This section is empty.

Functions

func DialTLS

func DialTLS(addr string, timeout time.Duration, cnf *tls.Config, f DialF) (net.Conn, error)

DialTLS 撥號 並 使用 tls

func KCPListen

func KCPListen(addr, certFile, keyFile string,
	timeout time.Duration,
	dataShards, parityShards int,
) (name string, l net.Listener, e error)

KCPListen 創建 kcp listener

func NewClientCreds

NewClientCreds 創建 h2c 密碼驗證 客戶端

func NewServerCreds

NewServerCreds 創建 密碼驗證 服務器

func TCPListen

func TCPListen(addr, certFile, keyFile string, timeout time.Duration) (name string, l net.Listener, e error)

TCPListen 創建 tcp listener

func WebsocketListen

func WebsocketListen(addr, certFile, keyFile string, timeout time.Duration) (name string, l net.Listener, e error)

WebsocketListen 創建 Websocket listener

Types

type Conn

type Conn struct {
	net.Conn
	sync.Mutex
	// contains filtered or unexported fields
}

Conn 包裝 net.Conn 一定時間 未活躍 關閉

func NewConn

func NewConn(c net.Conn, timeout time.Duration) *Conn

NewConn .

func (*Conn) Close

func (c *Conn) Close() (e error)

Close .

func (*Conn) Read

func (c *Conn) Read(b []byte) (n int, e error)

func (*Conn) Write

func (c *Conn) Write(b []byte) (n int, e error)

type DialF

type DialF func(string, time.Duration) (net.Conn, error)

DialF .

func TCPDial

func TCPDial(useTLS, skipVerify bool) (name string, f DialF)

TCPDial .

func WebsocketDial

func WebsocketDial(useTLS, skipVerify bool) (name string, f DialF)

WebsocketDial .

type KCPDialer

type KCPDialer struct {
	Name string
	Dial DialF
	// contains filtered or unexported fields
}

KCPDialer .

func KCPDial

func KCPDial(useTLS, skipVerify bool, dataShards, parityShards int) (dialer *KCPDialer)

KCPDial .

Directories

Path Synopsis
Package websocket implements a client and server for the WebSocket protocol as specified in RFC 6455.
Package websocket implements a client and server for the WebSocket protocol as specified in RFC 6455.

Jump to

Keyboard shortcuts

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