Documentation ¶
Index ¶
- func ConnectTCP(host string, port int, deadline time.Duration) (*net.TCPConn, error)
- func ConnectUDP(host string, port int, deadline time.Duration) (*net.UDPConn, error)
- func ReadTCP(connection *net.TCPConn, bufferSize int) (string, error)
- func WriteTCP(connection *net.TCPConn, payload string, endAfter bool) error
- func WriteUDP(connection *net.UDPConn, payload string) error
- type MessageData
- type ServerConfiguration
- type TCPConfiguration
- type TCPServer
- type UDPServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectTCP ¶
ConnectTCP - connects to the specified address
func ConnectUDP ¶
ConnectUDP - connects to the specified address
Types ¶
type MessageData ¶
MessageData - the message data received
type ServerConfiguration ¶
ServerConfiguration - common configuration
type TCPConfiguration ¶
type TCPConfiguration struct { ReadTimeout time.Duration WriteTimeout time.Duration ResponseString string ServerConfiguration }
TCPConfiguration - the tcp server configuration
type TCPServer ¶
type TCPServer struct {
// contains filtered or unexported fields
}
TCPServer - the tcp server
func NewTCPServer ¶
func NewTCPServer(configuration *TCPConfiguration, start bool) (*TCPServer, int)
NewTCPServer - creates a new telnet server on a random port
func (*TCPServer) MessageChannel ¶
func (ts *TCPServer) MessageChannel() <-chan MessageData
MessageChannel - reads from the message channel
type UDPServer ¶
type UDPServer struct {
// contains filtered or unexported fields
}
UDPServer - the udp server
func NewUDPServer ¶
func NewUDPServer(configuration *ServerConfiguration, start bool) (*UDPServer, int)
NewUDPServer - creates a new udp server on a random port
func (*UDPServer) MessageChannel ¶
func (us *UDPServer) MessageChannel() <-chan MessageData
MessageChannel - reads from the message channel
Click to show internal directories.
Click to hide internal directories.