pub struct OpenConnectRequest {
pub protocol: u8,
pub mtu_size: u16,
}
Expand description
This packet is the equivelant of the OpenConnectRequest
packet in RakNet.
This packet is sent by the peer to a server to request a connection.
It contains information about the client, such as the protocol version, and the mtu size.
The peer should expect a OpenConnectReply
packet in response to this packet, if the
server accepts the connection. Otherwise, the peer should expect a IncompatibleProtocolVersion
packet to be sent to indicate that the server does not support the protocol version.
Internally this packet is padded by the given
mtu_size
in the packet. This is done by appending null bytes
to the current buffer of the packet which is calculated by adding the difference
between the mtu_size
and the current length.
Fields§
§protocol: u8
§mtu_size: u16
Trait Implementations§
Source§impl Clone for OpenConnectRequest
impl Clone for OpenConnectRequest
Source§fn clone(&self) -> OpenConnectRequest
fn clone(&self) -> OpenConnectRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OpenConnectRequest
impl Debug for OpenConnectRequest
Source§impl From<OfflinePacket> for OpenConnectRequest
impl From<OfflinePacket> for OpenConnectRequest
Source§fn from(packet: OfflinePacket) -> Self
fn from(packet: OfflinePacket) -> Self
Source§impl From<OpenConnectRequest> for OfflinePacket
impl From<OpenConnectRequest> for OfflinePacket
Source§fn from(packet: OpenConnectRequest) -> Self
fn from(packet: OpenConnectRequest) -> Self
Source§impl From<OpenConnectRequest> for RakPacket
impl From<OpenConnectRequest> for RakPacket
Source§fn from(packet: OpenConnectRequest) -> Self
fn from(packet: OpenConnectRequest) -> Self
Source§impl From<RakPacket> for OpenConnectRequest
impl From<RakPacket> for OpenConnectRequest
Source§impl Reader<OpenConnectRequest> for OpenConnectRequest
impl Reader<OpenConnectRequest> for OpenConnectRequest
Source§fn read(buf: &mut ByteReader) -> Result<OpenConnectRequest, Error>
fn read(buf: &mut ByteReader) -> Result<OpenConnectRequest, Error>
Source§impl Writer for OpenConnectRequest
impl Writer for OpenConnectRequest
Source§fn write_to_bytes(&self) -> Result<ByteWriter, Error>
fn write_to_bytes(&self) -> Result<ByteWriter, Error>
Self
to a ByteWriter
without
needing to create a ByteWriter
first.