SmartSockets .NET Class Library

TipcSvc.createMt Method 

Defines a new message type.

Once a message type is defined, it may be looked up with the name and number lookup functions.

For example, to define a new message type named "foo", which has the number '500', and is intended to take two integer fields and a string field, you'd do this:

            TipcMt mt = TipcSvc.createMt("foo", 500, "int4 int4 str");
            

You may use the TipcMt object directly, or look up the instance by name or number, like any other predefined message type:

            // look up a message type by name
            TipcMt mt = TipcSvc.lookupMt("foo");
            
            // look up a message type by number
            TipcMt mt = TipcSvc.lookupMt(500);
            

public static TipcMt createMt(
   string name,
   int number,
   string grammar
);

Parameters

name
name of the new message type.
number
reference number of the new message type. Numbers less than 1 are reserved for SmartSockets standard message types. A message number of 0 should not be used.
grammar
printable grammar for the new message type. The grammer identifies the type and order of fields in the message type, and is used when printing a message of this type.

Return Value

a new object implementing the TipcMt interface.

Exceptions

Exception TypeCondition
TipcAlreadyExistsException An attempt was made to create a message type using a name or number that is already used by an existing message type.
TipcException For all other errors

See Also

TipcSvc Class | TipcSvc Members | TIBCO.SMARTSOCKETS Namespace | TipcMt | lookupMt | lookupMt


Copyright © TIBCO Software Inc. All rights reserved