com.onlineobject.objectnet Namespace

EmbeddedMessageHandlerAttribute Class

Specifies a method as the message handler for messages with the given ID.

Namespace:  com.onlineobject.objectnet.server
Assembly:  ObjectNetAPI (in ObjectNetAPI.dll)

Syntax


[AttributeUsageAttribute]

public sealed class EmbeddedMessageHandlerAttribute : Attribute

Remarks


In order for a method to qualify as a message handler, it must match a valid message handler method signature. EmbeddedServers will only use methods marked with this attribute if they match the EmbeddedServer..::..MessageHandler signature, and EmbeddedClients will only use methods marked with this attribute if they match the EmbeddedClient..::..MessageHandler signature.

Methods marked with this attribute which match neither of the valid message handler signatures will not be used by EmbeddedServers or EmbeddedClients and will cause warnings at runtime.

If you want a EmbeddedServer or EmbeddedClient to only use a subset of all message handler methods, you can do so by setting up custom message handler groups. Simply set the group ID in the EmbeddedMessageHandlerAttribute constructor and pass the same value to the Start(UInt16, UInt16, Byte, Boolean) or Connect(String, Int32, Byte, EmbeddedMessage, Boolean) method. This will make that EmbeddedServer or EmbeddedClient only use message handlers which have the same group ID.

Inheritance Hierarchy


Object
  Attribute
    com.onlineobject.objectnet.server..::..EmbeddedMessageHandlerAttribute