Documentation
¶
Overview ¶
Package tcpx Create on 2023/8/5 @author xuzhuoxi
Index ¶
- Variables
- func GetTCPAddr(network string, address string) (*net.TCPAddr, error)
- func TCPAddrEqual(addr1 *net.TCPAddr, addr2 *net.TCPAddr) bool
- type ITCPClient
- type ITCPServer
- type TCPClient
- type TCPServer
- func (s *TCPServer) CloseConnection(address string) (err error, ok bool)
- func (s *TCPServer) Connections() int
- func (s *TCPServer) FindConnection(address string) (conn netx.IServerConn, ok bool)
- func (s *TCPServer) SendBytesTo(data []byte, rAddress ...string) error
- func (s *TCPServer) SendPackTo(pack []byte, rAddress ...string) error
- func (s *TCPServer) SetMaxConn(max int)
- func (s *TCPServer) StartServer(params netx.SockParams) error
- func (s *TCPServer) StopServer() error
- type TcpSockConn
Constants ¶
This section is empty.
Variables ¶
View Source
var TcpDataBlockHandler = bytex.NewDefaultDataBlockHandler()
Functions ¶
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 (*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 (*TCPServer) Connections ¶
func (*TCPServer) FindConnection ¶ added in v1.0.4
func (s *TCPServer) FindConnection(address string) (conn netx.IServerConn, ok bool)
func (*TCPServer) SendBytesTo ¶
func (*TCPServer) SendPackTo ¶
func (*TCPServer) SetMaxConn ¶ added in v1.0.4
func (*TCPServer) StartServer ¶
func (s *TCPServer) StartServer(params netx.SockParams) error
func (*TCPServer) StopServer ¶
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
Click to show internal directories.
Click to hide internal directories.