network

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 4 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 Connect

func Connect(address string) (Connection, error)

创建自定义连接并根据address进行远程连接

func New

func New(conn net.Conn) Connection

使用已有连接创建自定义连接

func (Connection) Close

func (c Connection) Close()

func (Connection) LocalAddress

func (c Connection) LocalAddress() string

func (Connection) Read

func (c Connection) Read(length uint32) ([]byte, error)

func (Connection) ReadByte

func (c Connection) ReadByte() (byte, error)

读取一个单独的字节

func (Connection) ReadWithLength

func (c Connection) ReadWithLength() ([]byte, error)

func (Connection) RemoteAddress

func (c Connection) RemoteAddress() string

func (Connection) Write

func (c Connection) Write(data []byte) error

func (Connection) WriteWithLength

func (c Connection) WriteWithLength(source []byte) error

Jump to

Keyboard shortcuts

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