ctcp

package
v0.0.0-...-54275e6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2015 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DELIMITER = '\t'
)

Variables

This section is empty.

Functions

func Read

func Read(conn net.Conn, delim byte) (string, error)

func Write

func Write(conn net.Conn, content string) (int, error)

Types

type AsyncTcpListener

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

func (*AsyncTcpListener) Addr

func (self *AsyncTcpListener) Addr() net.Addr

func (*AsyncTcpListener) Close

func (self *AsyncTcpListener) Close() bool

func (*AsyncTcpListener) Init

func (self *AsyncTcpListener) Init(addr string) error

func (*AsyncTcpListener) Listen

func (self *AsyncTcpListener) Listen(handler func(conn net.Conn)) error

type AsyncTcpSender

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

func (*AsyncTcpSender) Addr

func (self *AsyncTcpSender) Addr() net.Addr

func (*AsyncTcpSender) Close

func (self *AsyncTcpSender) Close() bool

func (*AsyncTcpSender) Init

func (self *AsyncTcpSender) Init(remoteAddr string, timeout time.Duration) error

func (*AsyncTcpSender) Receive

func (self *AsyncTcpSender) Receive(delim byte) <-chan TcpMessage

func (*AsyncTcpSender) RemoteAddr

func (self *AsyncTcpSender) RemoteAddr() net.Addr

func (*AsyncTcpSender) Send

func (self *AsyncTcpSender) Send(content string) error

type TcpListener

type TcpListener interface {
	Init(addr string) error
	Listen(handler func(conn net.Conn)) error
	Close() bool
	Addr() net.Addr
}

func NewTcpListener

func NewTcpListener() TcpListener

type TcpMessage

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

func NewTcpMessage

func NewTcpMessage(content string, err error) TcpMessage

func (TcpMessage) Content

func (self TcpMessage) Content() string

func (TcpMessage) Err

func (self TcpMessage) Err() error

type TcpSender

type TcpSender interface {
	Init(remoteAddr string, timeout time.Duration) error
	Send(content string) error
	Receive(delim byte) <-chan TcpMessage
	Close() bool
	Addr() net.Addr
	RemoteAddr() net.Addr
}

func NewTcpSender

func NewTcpSender() TcpSender

Jump to

Keyboard shortcuts

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