conn

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(c1 *Conn, c2 *Conn)

will block until connection close

Types

type Conn

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

wrap for TCPConn

func ConnectServer

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

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() bool

func (*Conn) ReadLine

func (c *Conn) ReadLine() (buff string, err 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) Close

func (l *Listener) Close()

func (*Listener) GetConn

func (l *Listener) GetConn() (conn *Conn, err error)

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

Jump to

Keyboard shortcuts

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