SmartSockets .NET Class Library | |
TipcSvc Methods
The methods of the TipcSvc class are listed below. For a complete list of TipcSvc class members, see the TipcSvc Members topic.
Public Static Methods
 createConnClient | Creates a new peer-to-peer client connection.
This method creates the client end of a peer-to-peer connection.
The server end must be up and running prior to this call, so the
client has something to connect to. The protocol, hostname, and
port number for the connection are specified as a "logical
connection name" (LCN), using the form: protocol:hostname:port.
"_node" may be substituted for the local hostname.
Example:
// connect to a peer listening via TCP on host foo at port 8002
TipcConnClient conn = TipcSvc.createConnClient("tcp:foo:8002");
// create a SmartSockets message and send it to the server
TipcMsg msg = TipcSvc.createMsg(TipcMt_Fields.INFO);
msg.appendStr("hello");
conn.send(msg);
conn.flush();
|
 createConnServer | Create a new peer-to-peer server connection.
This method creates the server end of a peer-to-peer connection.
The protocol, hostname, and port number are specified using the
same "logical connection name" (LCN) as the client connection.
This connection is only used to accept connections from clients.
All actual communication is done with the client connection
returned by accept.
Example:
// create the server-side of a connection listening via TCP on port 8002
TipcConnServer srvConn = TipcSvc.createConnServer("tcp:_node:8002");
// accept a client connection
TipcConnClient conn = srvConn.accept();
// get the next message sent by the client
TipcMsg msg = conn.next(10.0);
|
 createMsg | Overloaded. Creates a new SmartSockets message of the specified message type.
Example:
// look up the message type number 500
TipcMt mt = TipcSvc.lookupMt(500);
// create a message of this type
TipcMsg msg = TipcSvc.createMsg(mt);
|
 createMt |
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);
|
 createSrv | Creates a new TipcSrv RTserver connection object.
All RTserver connections share a common set of options set by the
option assessor methods in the Tut class. Option values
for a particular connection object may be overridden by using the
option assessor methods available to the TipcSrv object,
inherited from the TipcConnClient interface.
The one exception is the ss.unique_subject option. A new
default unique subject will be generated for each TipcSrv object
created by the this method.
Note: this method will not create a connection to RTserver. Use
the create method to do this. The methods to send
and receive messages will also automatically connect to RTserver.
Example:
// create a new connection object
TipcSrv srv = TipcSvc.createSrv();
// set the unique subject of the connection
srv.setOption("ss.unique_subject", "/publish_client");
// create the connection to the RTserver
srv.create();
RTserver must be running before a connection is made. The .NET
library does not attempt to start an instance of RTserver.
|
 lookupMt | Overloaded. Returns the message type indexed by name.
This message type must be one of the standard SmartSockets message types,
or a type previously defined with createMt.
Example:
// look up the message type named "foo"
TipcMt mt = TipcSvc.lookupMt("foo");
|
 makeSubjectAbsolute | If the subject is not absolute (doesn't start with "/"), tack on
the default subject prefix, if it exists. If the prefix isn't
set to anything, it simply returns the original name untouched.
This method should only be invoked when using the global
RTserver connection via the Srv property.
Otherwise, use makeSubjectAbsolute.
|
 matchSubjects | Matches two subject strings, one or both of which may be
wildcarded.
Note: Subjects are not case sensitive.
|
 validSubject | Checks that the subject is valid. Invalid subjects are null
or empty subjects, those with only whitespace between subject delimiters.
|
Public Instance Methods
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object. |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table. |
GetType (inherited from Object) | Gets the Type of the current instance. |
ToString (inherited from Object) | Returns a String that represents the current Object. |
Protected Instance Methods
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. |
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object. |
See Also
TipcSvc Class | TIBCO.SMARTSOCKETS Namespace
Copyright © TIBCO Software Inc. All rights reserved