Drag[en]gine Script Module DragonScript  1.23
Dragengine.Networking.NetworkMessage Class Reference

Network message. More...

Inheritance diagram for Dragengine.Networking.NetworkMessage:

Public Member Functions

Constructors
NetworkMessage new ()
 Create network message. More...
 
Management
int getDataLength ()
 Llength of the message data. More...
 
void clear ()
 Clear message data. More...
 
FileReader getReader ()
 Get new FileReader starting reading at the start of the data. More...
 
FileWriter getWriter (bool append)
 Get new FileWriter. More...
 

Detailed Description

Network message.

This is a native class.

Member Function Documentation

◆ clear()

void Dragengine.Networking.NetworkMessage.clear ( )

Clear message data.

◆ getDataLength()

int Dragengine.Networking.NetworkMessage.getDataLength ( )

Llength of the message data.

◆ getReader()

FileReader Dragengine.Networking.NetworkMessage.getReader ( )

Get new FileReader starting reading at the start of the data.

Multiple file readers can be active on the same message at different read positions. If the data is changed while file readers are using this message file the next read calls can cause exceptions due to reading past the end of file.

◆ getWriter()

FileWriter Dragengine.Networking.NetworkMessage.getWriter ( bool  append)

Get new FileWriter.

Using multiple file writers is allowed but discouraged. Each writer maintain its own write position. If multiple writers attempt to write on the same message file the data is overwritten. If you need to use multiple file writers you have to manually move the write pointers to the right location.

If file readers are using this message file while writers change the content the next read calls can cause exceptions due to reading past the end of file.

Parameters
appendIf true start writing at end of data. If false resizes data to 0 bytes and starts writing.

◆ new()

NetworkMessage Dragengine.Networking.NetworkMessage.new ( )

Create network message.


The documentation for this class was generated from the following file: