Class SoMessageHeader
This is the first and current version of the SuperOffice Network header and immidiatly precedes the SoMessagePreHeader.
Inheritance
Inherited Members
Namespace: SuperOffice.Messaging.Messages
Assembly: SoDataBase.dll
Syntax
public class SoMessageHeader : SoMessagePreHeader
Remarks
Maximum size for an UDP packet is 1472 bytes. Using 96 bytes for the header leaves 1376 bytes for the message itself.
This should be the base class for all Messages sent over the network.
Constructors
SoMessageHeader()
Constructor used by serializer.
Declaration
public SoMessageHeader()
SoMessageHeader(SoMessageType, Guid)
Constructur used by sub-classes to initialize the header.
Declaration
protected SoMessageHeader(SoMessageType messageType, Guid sourceId)
Parameters
| Type | Name | Description |
|---|---|---|
| SoMessageType | messageType | Type of Message. |
| Guid | sourceId | Source ID (GUID) of the sender of the message. |
Fields
BodySize
Declaration
public uint BodySize
Field Value
| Type | Description |
|---|---|
| UInt32 |
HeaderSize
Declaration
public uint HeaderSize
Field Value
| Type | Description |
|---|---|
| UInt32 |
MessageId
Declaration
public Guid MessageId
Field Value
| Type | Description |
|---|---|
| Guid |
MessageType
Declaration
public SoMessageType MessageType
Field Value
| Type | Description |
|---|---|
| SoMessageType |
SourceId
Declaration
public Guid SourceId
Field Value
| Type | Description |
|---|---|
| Guid |
TargetId
Declaration
public Guid TargetId
Field Value
| Type | Description |
|---|---|
| Guid |
Properties
Description
Get description about the message. Default description is the first 253 characters of the full name of the message's type.
Declaration
public virtual string Description { get; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
IsForMe(Guid)
Check if the message is valid and is intended for the provided source id.
Declaration
public bool IsForMe(Guid sourceId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | sourceId | Source ID to check against. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the message is intended for the provided source id. |
Remarks
Broadcast messages will show that they are intended for any source id.
IsValidate()
Verify if the header is valid
Declaration
public virtual bool IsValidate()
Returns
| Type | Description |
|---|---|
| Boolean | True if the header is valid. |
PrepareDatabaseMessage(MessageRow)
Declaration
public virtual bool PrepareDatabaseMessage(MessageRow row)
Parameters
| Type | Name | Description |
|---|---|---|
| MessageRow | row |
Returns
| Type | Description |
|---|---|
| Boolean |