conn

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	TcpConn net.Conn
	Reader  *bufio.Reader
	// contains filtered or unexported fields
}

wrap for TCPConn

func ConnectServer

func ConnectServer(host string, port int64) (c *Conn, err error)

func NewConn added in v0.5.0

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

func (*Conn) Close

func (c *Conn) Close()

func (*Conn) GetLocalAddr

func (c *Conn) GetLocalAddr() (addr string)

func (*Conn) GetRemoteAddr

func (c *Conn) GetRemoteAddr() (addr string)

func (*Conn) IsClosed

func (c *Conn) IsClosed() (closeFlag bool)

func (*Conn) ReadLine

func (c *Conn) ReadLine() (buff string, err error)

func (*Conn) SetDeadline added in v0.5.0

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

func (*Conn) Write

func (c *Conn) Write(content string) (err error)

type Listener

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

func Listen

func Listen(bindAddr string, bindPort int64) (l *Listener, err error)

func (*Listener) Accept added in v0.5.0

func (l *Listener) Accept() (*Conn, error)

wait util get one new connection or listener is closed if listener is closed, err returned

func (*Listener) Close

func (l *Listener) Close() error

Jump to

Keyboard shortcuts

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