Documentation ¶
Overview ¶
Package udpx Create on 2023/8/5 @author xuzhuoxi
Index ¶
- Constants
- Variables
- func GetUDPAddr(network string, address string) (*net.UDPAddr, error)
- func UDPAddrEqual(addr1 *net.UDPAddr, addr2 *net.UDPAddr) bool
- type IUDPClient
- type IUDPServer
- type UDPConnAdapter
- type UDPDialClient
- type UDPListenClient
- type UDPServer
- func (s *UDPServer) CloseConnection(address string) (err error, ok bool)
- func (s *UDPServer) Connections() int
- func (s *UDPServer) FindConnection(address string) (conn netx.IServerConn, ok bool)
- func (s *UDPServer) SendBytesTo(bytes []byte, rAddress ...string) error
- func (s *UDPServer) SendPackTo(pack []byte, rAddress ...string) error
- func (s *UDPServer) SetMaxConn(max int)
- func (s *UDPServer) StartServer(params netx.SockParams) error
- func (s *UDPServer) StopServer() error
- type UdpSockConn
Constants ¶
View Source
const (
UDPBuffLength = 4096
)
Variables ¶
View Source
var UdpDataBlockHandler = bytex.NewDefaultDataBlockHandler()
Functions ¶
Types ¶
type IUDPClient ¶
type IUDPClient interface { netx.ISockClient }
func NewUDP4DialClient ¶
func NewUDP4DialClient() IUDPClient
func NewUDP4ListenClient ¶
func NewUDP4ListenClient() IUDPClient
func NewUDP6DialClient ¶
func NewUDP6DialClient() IUDPClient
func NewUDP6ListenClient ¶
func NewUDP6ListenClient() IUDPClient
func NewUDPDialClient ¶
func NewUDPDialClient() IUDPClient
func NewUDPListenClient ¶
func NewUDPListenClient() IUDPClient
type IUDPServer ¶
type IUDPServer interface { netx.ISockServer eventx.IEventDispatcher }
func NewUDP4Server ¶
func NewUDP4Server() IUDPServer
func NewUDP6Server ¶
func NewUDP6Server() IUDPServer
func NewUDPServer ¶
func NewUDPServer() IUDPServer
type UDPConnAdapter ¶
func (*UDPConnAdapter) ReadBytes ¶
func (rw *UDPConnAdapter) ReadBytes(bytes []byte) (n int, address string, err error)
func (*UDPConnAdapter) RemoteAddress ¶
func (rw *UDPConnAdapter) RemoteAddress() string
func (*UDPConnAdapter) WriteBytes ¶
func (rw *UDPConnAdapter) WriteBytes(bytes []byte, rAddress ...string) (n int, err error)
type UDPDialClient ¶
type UDPDialClient struct {
netx.SockClientBase
}
func (*UDPDialClient) CloseClient ¶
func (c *UDPDialClient) CloseClient() error
func (*UDPDialClient) OpenClient ¶
func (c *UDPDialClient) OpenClient(params netx.SockParams) error
type UDPListenClient ¶
type UDPListenClient struct {
netx.SockClientBase
}
func (*UDPListenClient) CloseClient ¶
func (c *UDPListenClient) CloseClient() error
func (*UDPListenClient) OpenClient ¶
func (c *UDPListenClient) OpenClient(params netx.SockParams) error
type UDPServer ¶
type UDPServer struct { eventx.EventDispatcher netx.SockServerBase lang.ChannelLimitNone // contains filtered or unexported fields }
func (*UDPServer) CloseConnection ¶
func (*UDPServer) Connections ¶
func (*UDPServer) FindConnection ¶ added in v1.0.4
func (s *UDPServer) FindConnection(address string) (conn netx.IServerConn, ok bool)
func (*UDPServer) SendBytesTo ¶
func (*UDPServer) SendPackTo ¶
func (*UDPServer) SetMaxConn ¶ added in v1.0.4
func (*UDPServer) StartServer ¶
func (s *UDPServer) StartServer(params netx.SockParams) error
func (*UDPServer) StopServer ¶
type UdpSockConn ¶ added in v1.0.4
type UdpSockConn struct { Address string SRProxy netx.IPackSendReceiver }
func (*UdpSockConn) ClientAddress ¶ added in v1.0.4
func (o *UdpSockConn) ClientAddress() string
func (*UdpSockConn) CloseConn ¶ added in v1.0.4
func (o *UdpSockConn) CloseConn() error
func (*UdpSockConn) SendBytes ¶ added in v1.0.4
func (o *UdpSockConn) SendBytes(bytes []byte) error
func (*UdpSockConn) SendPack ¶ added in v1.0.4
func (o *UdpSockConn) SendPack(data []byte) error
Click to show internal directories.
Click to hide internal directories.