socket

package
v0.0.0-...-f33b5a6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Disconnected = -1
	Handshaking  = 0
	Status       = 1
	Login        = 2
	Play         = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet

type Packet interface {
	Encode(writer *minecraft.Writer)
}

type Socket

type Socket struct {
	net.Conn

	// the protocol state
	State int
	// contains filtered or unexported fields
}

func NewSocket

func NewSocket(conn net.Conn) Socket

func (*Socket) Close

func (s *Socket) Close()

func (*Socket) EnableCompression

func (s *Socket) EnableCompression()

func (*Socket) Recv

func (s *Socket) Recv() ([]byte, error)

func (*Socket) Send

func (s *Socket) Send(packet Packet)

func (*Socket) SendChan

func (s *Socket) SendChan(packet Packet, done chan bool)

func (*Socket) SendRaw

func (s *Socket) SendRaw(data []byte)

func (*Socket) SendRawChan

func (s *Socket) SendRawChan(data []byte, done chan bool)

func (*Socket) SendRawSync

func (s *Socket) SendRawSync(data []byte)

func (*Socket) SendSync

func (s *Socket) SendSync(packet Packet)

func (*Socket) StartSend

func (s *Socket) StartSend()

Jump to

Keyboard shortcuts

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