Documentation
¶
Index ¶
Constants ¶
View Source
const ( EventTypeConnect = C.ENET_EVENT_TYPE_CONNECT EventTypeDisconnect = C.ENET_EVENT_TYPE_DISCONNECT EventTypeReceive = C.ENET_EVENT_TYPE_RECEIVE )
View Source
const ( PacketFlagNone = 0 PacketFlagReliable = (1 << 0) PacketFlagUnsequenced = (1 << 1) PacketFlagNoAllocate = (1 << 2) PacketFlagUnreliableFragment = (1 << 3) PacketFlagSent = (1 << 8) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ENetSocketType ¶
type ENetSocketType int
type Host ¶
func (*Host) Disconnect ¶
type Peer ¶
type Peer struct {
Address *net.UDPAddr
State PeerState
CPeer *C.ENetPeer
// Messages for which we have yet to receive ACKs
Pending []PendingPacket
Queued []QueuedPacket
Mutex deadlock.Mutex
}
type PendingPacket ¶
type QueuedPacket ¶
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
func NewDatagramSocket ¶
func (*Socket) DestroySocket ¶
func (sock *Socket) DestroySocket()
func (*Socket) SendDatagram ¶
func (sock *Socket) SendDatagram(address C.ENetAddress, data []byte)
func (*Socket) SendString ¶
func (*Socket) Service ¶
func (sock *Socket) Service() <-chan SocketMessage
type SocketMessage ¶
type SocketMessage struct {
Address C.ENetAddress
Data []byte
}
Click to show internal directories.
Click to hide internal directories.