clients

package
v0.0.0-...-98017eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCPClient

type TCPClient struct {
	Host string

	Reader *bufio.Reader
	Writer *bufio.Writer
	// contains filtered or unexported fields
}

TCPClient defines the structure of the TCP client.

func NewTCPClientWithPort

func NewTCPClientWithPort(xboxIP string, port int) (*TCPClient, error)

NewTCPClientWithPort creates a new TCPClient with an Xbox's IP and listening port.

func (*TCPClient) Close

func (client *TCPClient) Close()

Close ends the open TCP connection.

func (*TCPClient) Read

func (client *TCPClient) Read(len int64) ([]byte, int, error)

Read reads the pending response from the xbox.

func (*TCPClient) ReadString

func (client *TCPClient) ReadString() (string, error)

ReadString reads a string response from the Xbox.

func (*TCPClient) Write

func (client *TCPClient) Write(data []byte) (int, error)

Write sends a byte slice to the xbox.

func (*TCPClient) WriteString

func (client *TCPClient) WriteString(message string) (int, error)

WriteString sends a command to the Xbox. This function will suffix the command with `\r\n`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL