BinMessage Class

From RemObjects Software

Jump to: navigation, search

This is a RemObjects SDK Architecture entry
Feel free to add your notes to this topic below.



Overview (.NET)

The BinMessage component implements a Message type that can be used to encode messages in a proprietary binary format to send between client and server. Though the format used is proprietary, it is highly efficient and small. For a slower, but an open-standard protocol, use SOAP Message.

The BinMessage format is compatible with the BinMessage component used by the RemObjects SDK for Delphi. Make sure to use Version 2.0.0.135 or newer in the Delphi side to communicate with .NET based RemObjects SDK applications.

Namespace

Declaration (C#)

[System.Drawing.ToolboxBitmap(typeof(RemObjects.SDK.Message), "Glyphs.BinMessage.bmp")]
public class BinMessage : RemObjects.SDK.Message;

Hierarchy

  • RemObjects.SDK.Message
    • RemObjects.SDK.BinMessage

Properties

Property
Type
Description
ContentType String
DefaultDispatcherName String This property will return the default/recommended dispatcher name for the message type.

For BinMessage, this will always be the string constant "bin".

EnforceMaxMessageSize Boolean Toggles whether the MaxMessageSize and MaxDecompressedMessageSize values will be enforced for incoming messages (true) or not (false).

The recommendation is to have this enabled for servers and for clients that will talk to potentially non-trusted server applications.

MaxDecompressedMessageSize Integer Controls the maximum message size to be received.

The message class will reject messages that, when extracted, are larger then the configured value. This is to avoid malicious users overloading the server by sending spoofed ZLib packets that are small but expand to large blocks.

MaxMessageSize Integer Controls the maximum message size to be received.

This serves as a security measure to prevent denial-of-service attacks, as it prevents attackers from bringing down your application by sending huge messages.

MessageVersion Integer Contains the version number of the last message received.

The currently supported message version is 107; future builds of the RemObjects SDK might contain extended support for newer message versions, if changes to the message format are introduced.

MinSizeForCompression Integer Minimum size for a message before compression is applied (default is 4096 bytes).

Messages below this threshold are sent uncompressed, as the overhead of compressing and decompressing the data would likely outweigh the gain of having only slightly smaller packet on the network.

UseCompression Boolean Determines whether Compression will be used for outgoing messages.

The message will be able to handle compressed and uncompressed incoming messages, regardless of this setting. Check the BinHeader's Compressed property to determine if compression was used on an incoming message.

ReadExcepton System.Exception Reads the current message as an exception, then returns a new Exception instance, properly initialized with the message values.


Methods

Method
Description
BinMessage Default Constructor for BinMessage.
Clear Clears all internal data structures and prepare the BinMessage class to handle the processing of a new message.
Clone Creates and returns an identical copy of the message.
InitializeEventMessage
InitializeExceptionMessage
InitializeMessage
InitializeMessageEx
ReadException Reads the current message as an exception, then returns a new Exception instance, properly initialized with the message values.
ReadFromStream Reads the contents of the message from the given stream.
Validate
WriteException Writes the given exception to the message.
WriteToStream Writes the given stream to the message.


See Also


Product: RemObjects SDK
Current version: RemObjects SDK 'Vinci' (5.0)

ListsGlossaryFeaturesHow ToComponentsToolsSamplesArticlesArchitectureIssues

Personal tools