tcp_protocol

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TcpConnProtocol = "tcp"

Variables

This section is empty.

Functions

This section is empty.

Types

type TcpConnection

type TcpConnection struct {
	Conn  net.Conn
	Mutex sync.Mutex
	// contains filtered or unexported fields
}

func NewTcpConnection

func NewTcpConnection(conn net.Conn) *TcpConnection

func (*TcpConnection) Addr

func (this *TcpConnection) Addr() string

func (*TcpConnection) Close

func (this *TcpConnection) Close() error

func (*TcpConnection) ConnProtocol added in v1.0.1

func (this *TcpConnection) ConnProtocol() string

func (*TcpConnection) ReadMsg

func (this *TcpConnection) ReadMsg() ([]byte, error)

func (*TcpConnection) SetFlowProtocolHandler

func (this *TcpConnection) SetFlowProtocolHandler(flowProtocolHandler protocol.Proto)

func (*TcpConnection) WriteMsg

func (this *TcpConnection) WriteMsg(data []byte) error

WriteMsg send byte array message

type TcpProtocol

type TcpProtocol struct {
}

func (*TcpProtocol) Dial

func (this *TcpProtocol) Dial(addr string) (protocol.Connection, error)

func (*TcpProtocol) ListenAndServe

func (this *TcpProtocol) ListenAndServe(port int64, onConnect func(conn protocol.Connection)) error

Jump to

Keyboard shortcuts

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