tcpx

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Overview

Package tcpx Create on 2023/8/5 @author xuzhuoxi

Index

Constants

This section is empty.

Variables

View Source
var TcpDataBlockHandler = bytex.NewDefaultDataBlockHandler()

Functions

func GetTCPAddr

func GetTCPAddr(network string, address string) (*net.TCPAddr, error)

func TCPAddrEqual

func TCPAddrEqual(addr1 *net.TCPAddr, addr2 *net.TCPAddr) bool

Types

type ITCPClient

type ITCPClient interface {
	netx.ISockClient
}

func NewTCP4Client

func NewTCP4Client() ITCPClient

func NewTCP6Client

func NewTCP6Client() ITCPClient

func NewTCPClient

func NewTCPClient() ITCPClient

type ITCPServer

type ITCPServer interface {
	netx.ISockServer
	eventx.IEventDispatcher
}

func NewTCP4Server

func NewTCP4Server() ITCPServer

func NewTCP6Server

func NewTCP6Server() ITCPServer

func NewTCPServer

func NewTCPServer() ITCPServer

type TCPClient

type TCPClient struct {
	netx.SockClientBase
}

func (*TCPClient) CloseClient

func (c *TCPClient) CloseClient() error

func (*TCPClient) OpenClient

func (c *TCPClient) OpenClient(params netx.SockParams) error

type TCPServer

type TCPServer struct {
	eventx.EventDispatcher
	netx.SockServerBase
	// contains filtered or unexported fields
}

func (*TCPServer) CloseConnection

func (s *TCPServer) CloseConnection(address string) (err error, ok bool)

func (*TCPServer) Connections

func (s *TCPServer) Connections() int

func (*TCPServer) FindConnection added in v1.0.4

func (s *TCPServer) FindConnection(address string) (conn netx.IServerConn, ok bool)

func (*TCPServer) SendBytesTo

func (s *TCPServer) SendBytesTo(data []byte, rAddress ...string) error

func (*TCPServer) SendPackTo

func (s *TCPServer) SendPackTo(pack []byte, rAddress ...string) error

func (*TCPServer) SetMaxConn added in v1.0.4

func (s *TCPServer) SetMaxConn(max int)

func (*TCPServer) StartServer

func (s *TCPServer) StartServer(params netx.SockParams) error

func (*TCPServer) StopServer

func (s *TCPServer) StopServer() error

type TcpSockConn added in v1.0.4

type TcpSockConn struct {
	Address string
	SRProxy netx.IPackSendReceiver
	Conn    *net.TCPConn
}

func (*TcpSockConn) ClientAddress added in v1.0.4

func (o *TcpSockConn) ClientAddress() string

func (*TcpSockConn) CloseConn added in v1.0.4

func (o *TcpSockConn) CloseConn() error

func (*TcpSockConn) SendBytes added in v1.0.4

func (o *TcpSockConn) SendBytes(bytes []byte) error

func (*TcpSockConn) SendPack added in v1.0.4

func (o *TcpSockConn) SendPack(data []byte) error

Jump to

Keyboard shortcuts

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