Host

Encompasses an ENetHost structure with an object-oriented wrapper

class Host {}

Constructors

this
this(ENet enet, Address* address, size_t peerCount, size_t channelLimit, uint incomingBandwidth, uint outgoingBandwidth)

Creates a new Host

Destructor

~this
~this()
Undocumented in source.

Members

Functions

broadcast
void broadcast(Packet packet, ubyte channelID)

Queues a packet to be sent to all peers associated with the host

checkEvents
Event checkEvents()

Checks for any queued events on the host and dispatches one if available

close
void close()

Cleans up any resources used by the Host

compressWithRangeCoder
void compressWithRangeCoder()

Sets the packet compressor the host should use to the default range coder

connect
Peer connect(Address foreignAddress, size_t channelCount, uint data)

Initiates a connection to a foreign host

connect
Peer connect(string hostName, ushort port, size_t channelCount, uint data)

Initiates a connection to a foreign host

disableRangeCoder
void disableRangeCoder()

Turns off the range coder packet compressor

flush
void flush()

Sends any queued packets on the host specified to its designated peers

service
Event service(uint timeout)

Waits for events on the host and shuttles packets between the host and its peers

Properties

address
Address address [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
bandwidthLimitedPeers
size_t bandwidthLimitedPeers [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
bandwidthLimits
uint[2] bandwidthLimits [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
bandwidthLimits
uint[2] bandwidthLimits [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
bandwidthThrottleEpoch
uint bandwidthThrottleEpoch [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
bufferCount
size_t bufferCount [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
buffers
ENetBuffer[] buffers [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
channelLimit
size_t channelLimit [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
channelLimit
size_t channelLimit [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
checksum
ENetChecksumCallback checksum [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
checksum
ENetChecksumCallback checksum [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
commandCount
size_t commandCount [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
commands
ENetProtocol[] commands [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
compress
bool compress [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
compress
bool compress [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
compressor
ENetCompressor compressor [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
compressor
ENetCompressor compressor [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
connectedPeers
size_t connectedPeers [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
continueSending
int continueSending [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
dispatchQueue
ENetList dispatchQueue [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
duplicatePeers
size_t duplicatePeers [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
duplicatePeers
size_t duplicatePeers [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
headerFlags
ushort headerFlags [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
incomingBandwidth
uint incomingBandwidth [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
incomingBandwidth
uint incomingBandwidth [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
intercept
ENetInterceptCallback intercept [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
intercept
ENetInterceptCallback intercept [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
mtu
uint mtu [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
outgoingBandwidth
uint outgoingBandwidth [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
outgoingBandwidth
uint outgoingBandwidth [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
packetData
ubyte[ENET_PROTOCOL_MAXIMUM_MTU][2] packetData [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
packetSize
size_t packetSize [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
peerCount
size_t peerCount [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
peers
Peer[] peers [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
randomSeed
uint randomSeed [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
recalculateBandwidthLimits
int recalculateBandwidthLimits [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
receivedAddress
Address receivedAddress [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
receivedData
ubyte* receivedData [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
receivedDataLength
size_t receivedDataLength [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
serviceTime
uint serviceTime [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
socket
ENetSocket socket [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
totalReceivedData
uint totalReceivedData [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
totalReceivedPackets
uint totalReceivedPackets [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
totalSentData
uint totalSentData [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
totalSentPackets
uint totalSentPackets [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_enet
ENet _enet;
Undocumented in source.
_handle
ENetHost* _handle;
Undocumented in source.

See Also

Client, Server

Meta