Documentation
¶
Index ¶
- Variables
- type Channel
- type MockUdpChannel
- type MockUdpServerChannel
- type ServerChannel
- type UDPClientConn
- func (c *UDPClientConn) Close() error
- func (c *UDPClientConn) LocalAddr() net.Addr
- func (c *UDPClientConn) Read(b []byte) (n int, err error)
- func (c *UDPClientConn) RemoteAddr() net.Addr
- func (c *UDPClientConn) SetDeadline(t time.Time) error
- func (c *UDPClientConn) SetReadDeadline(t time.Time) error
- func (c *UDPClientConn) SetWriteDeadline(t time.Time) error
- func (c *UDPClientConn) Write(b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
var ErrBindTwice = fmt.Errorf("bind twice")
var ErrNotUDPAddr = fmt.Errorf("not udp addr")
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
channel.DefaultNetChannel
}
Channel represents a UDP client channel implementation
type MockUdpChannel ¶
type MockUdpChannel struct {
channel.MockNetChannel
}
MockUdpChannel is a mock implementation of UDP Channel It embeds MockNetChannel to provide proper mock inheritance
func NewMockUdpChannel ¶
func NewMockUdpChannel() *MockUdpChannel
NewMockUdpChannel creates a new MockUdpChannel instance
func (*MockUdpChannel) UnsafeConnect ¶
UnsafeConnect mocks the UnsafeConnect method with UDP address validation
type MockUdpServerChannel ¶
type MockUdpServerChannel struct {
channel.MockServerChannel
// contains filtered or unexported fields
}
MockUdpServerChannel is a mock implementation of UDP ServerChannel It embeds MockServerChannel to provide proper mock inheritance
func NewMockUdpServerChannel ¶
func NewMockUdpServerChannel() *MockUdpServerChannel
NewMockUdpServerChannel creates a new MockUdpServerChannel instance
func (*MockUdpServerChannel) IsActive ¶
func (m *MockUdpServerChannel) IsActive() bool
IsActive mocks the IsActive method
func (*MockUdpServerChannel) UnsafeAccept ¶
func (m *MockUdpServerChannel) UnsafeAccept() (channel.Channel, channel.Future)
UnsafeAccept mocks the UnsafeAccept method
func (*MockUdpServerChannel) UnsafeBind ¶
func (m *MockUdpServerChannel) UnsafeBind(localAddr net.Addr) error
UnsafeBind mocks the UnsafeBind method with UDP binding logic
func (*MockUdpServerChannel) UnsafeClose ¶
func (m *MockUdpServerChannel) UnsafeClose() error
UnsafeClose mocks the UnsafeClose method
type ServerChannel ¶
type ServerChannel struct {
channel.DefaultNetServerChannel
// contains filtered or unexported fields
}
ServerChannel represents a UDP server channel implementation
func (*ServerChannel) IsActive ¶
func (c *ServerChannel) IsActive() bool
IsActive returns whether the UDP server is currently active
func (*ServerChannel) UnsafeAccept ¶
func (c *ServerChannel) UnsafeAccept() (channel.Channel, channel.Future)
UnsafeAccept for UDP servers - since UDP is connectionless, this creates a virtual channel that represents communication with a specific remote address
func (*ServerChannel) UnsafeBind ¶
func (c *ServerChannel) UnsafeBind(localAddr net.Addr) error
UnsafeBind binds the UDP server to the specified local address
func (*ServerChannel) UnsafeClose ¶
func (c *ServerChannel) UnsafeClose() error
UnsafeClose closes the UDP server connection
type UDPClientConn ¶
type UDPClientConn struct {
// contains filtered or unexported fields
}
UDPClientConn represents a virtual connection to a specific UDP client This allows UDP to work with the existing channel framework
func (*UDPClientConn) Close ¶
func (c *UDPClientConn) Close() error
Close implements net.Conn interface for UDP client connections
func (*UDPClientConn) LocalAddr ¶
func (c *UDPClientConn) LocalAddr() net.Addr
LocalAddr implements net.Conn interface for UDP client connections
func (*UDPClientConn) Read ¶
func (c *UDPClientConn) Read(b []byte) (n int, err error)
Read implements net.Conn interface for UDP client connections
func (*UDPClientConn) RemoteAddr ¶
func (c *UDPClientConn) RemoteAddr() net.Addr
RemoteAddr implements net.Conn interface for UDP client connections
func (*UDPClientConn) SetDeadline ¶
func (c *UDPClientConn) SetDeadline(t time.Time) error
SetDeadline implements net.Conn interface for UDP client connections
func (*UDPClientConn) SetReadDeadline ¶
func (c *UDPClientConn) SetReadDeadline(t time.Time) error
SetReadDeadline implements net.Conn interface for UDP client connections
func (*UDPClientConn) SetWriteDeadline ¶
func (c *UDPClientConn) SetWriteDeadline(t time.Time) error
SetWriteDeadline implements net.Conn interface for UDP client connections