socket

package module
v0.0.0-...-c14a072 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listen

type Listen struct {
	// contains filtered or unexported fields
}

监听结构

func NewListen

func NewListen(addr string, port string, maxRetry int) *Listen

创建监听对象

func (*Listen) ListenTCP

func (lt *Listen) ListenTCP() (*net.TCPListener, error)

TCP监听

func (*Listen) ListenUDP

func (lt *Listen) ListenUDP() (*net.UDPConn, error)

UDP监听

type TCP

type TCP struct {
	// contains filtered or unexported fields
}

根据 TCP 实现接口

func NewTCP

func NewTCP(addr string, port string, maxRetry int) *TCP

建立一个 TCP 对象

func (*TCP) ReadWrite

func (tcp *TCP) ReadWrite(rw func(conn *net.TCPConn) error) error

使用连接

type UDP

type UDP struct {
	// contains filtered or unexported fields
}

根据 UDP 实现接口

func NewUDP

func NewUDP(addr string, port string, maxRetry int) *UDP

建立一个 TCP 对象

func (*UDP) ReadWrite

func (udp *UDP) ReadWrite(rw func(conn *net.UDPConn) error) error

使用连接

Jump to

Keyboard shortcuts

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