Documentation ¶
Overview ¶
Package network encapsulates functionalities related to network communication. It provides a structure and associated methods to create and parse data frames for messaging across the fusion network protocol ensuring reliability and structure.
Package network encapsulates the logic required to set up network connections and communication, including TCP and TLS encrypted connections, along with handling different types of messages such as text and binary. It uses the fusion network protocol to ensuring reliability and structure.
Index ¶
Constants ¶
const ( TCPConnection uint8 = 0x0 TLSConnection uint8 = 0x1 TextMessage uint8 = 0x1 BinaryMessage uint8 = 0x2 )
Predefined constants for identifying connection and message types.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener struct { Cert string Key string Ready func(conn net.Conn) Message func(conn net.Conn, data []byte, opcode uint8) Failed func(conn net.Conn, err error) Cancelled func(conn net.Conn) // contains filtered or unexported fields }
Listener struct represents a TCP based connection listener that handles incoming pure TCP connections or TLS encrypted connections.
func (*Listener) Cancel ¶
func (listener *Listener) Cancel()
Cancel stops the listener from accepting new connections and closes any existing ones.
func (*Listener) SendMessage ¶ added in v1.4.0
SendMessage sends a message through the specified connection.