Documentation
¶
Index ¶
- type Connection
- type TCPConnection
- func (tcpConn *TCPConnection) Connect() error
- func (tcpConn *TCPConnection) Disconnect() error
- func (tcpConn *TCPConnection) IsConnected() bool
- func (tcpConn *TCPConnection) Listen()
- func (tcpConn *TCPConnection) ReadStringFromConnection() (string, error)
- func (tcpConn *TCPConnection) Write(data []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type TCPConnection ¶
type TCPConnection struct {
// contains filtered or unexported fields
}
func NewTCPConnection ¶
func NewTCPConnection(serverHost string, serverPort string) TCPConnection
NewTCPConnection creates a new TCP connection to the server provided
func (*TCPConnection) Connect ¶
func (tcpConn *TCPConnection) Connect() error
Connect connects to the tcp server
func (*TCPConnection) Disconnect ¶
func (tcpConn *TCPConnection) Disconnect() error
Disconnect disconnects form the tcp server and closes all internal channels and cancel all internal contexts
func (*TCPConnection) IsConnected ¶
func (tcpConn *TCPConnection) IsConnected() bool
IsConnected gives connection status
func (*TCPConnection) Listen ¶
func (tcpConn *TCPConnection) Listen()
Listen listens to the incoming messages and writes outgoing messages to the connection
func (*TCPConnection) ReadStringFromConnection ¶
func (tcpConn *TCPConnection) ReadStringFromConnection() (string, error)
ReadStringFromConnection is a blocking call that reads from a channel
func (*TCPConnection) Write ¶
func (tcpConn *TCPConnection) Write(data []byte)
Write writes the bytes array to the TCP connection
Click to show internal directories.
Click to hide internal directories.