SmartSockets .NET Class Library

Tut Methods

The methods of the Tut class are listed below. For a complete list of Tut class members, see the Tut Members topic.

Public Static Methods

affirmOverloaded. Tests a condition for truth, throws a TipcAssertionException if the test fails, using an explanatory message.
assertOverloaded. Tests a condition for truth, throws a TipcAssertionException if the test fails, using an explanatory message.
convertUcs2ToUtf8 Converts a Unicode string to a null-terminated, UTF-8 encoded, array of bytes. Note that this encoding is not the same as the default writeUTF and readUTF encoding, which is a length, data encoding. Our encoding is fully compatible with standard C ASCII strings so long as only ASCII is used. The default encoding is not only incompatible with this, but requires knowledge of the endian to swap the two-byte length.
convertUcs2ToUtf8Ex Converts a Unicode string to a null-terminated, UTF-8 encoded, array of bytes. Note that this encoding is not the same as the default writeUTF and readUTF encoding, which is a length, data encoding. Our encoding is fully compatible with standard C ASCII strings so long as only ASCII is used. The default encoding is not only incompatible with this, but requires knowledge of the endian to swap the two-byte length. This method returns an instance of a TipcUtf8Buffer class which increases the performance. Instead of copying a the buffer, an instance of the TipcUtf8Buffer class is returned, which contains the buffer and the offset and length of the UTF8 data.
createGuid Creates a guid.
createOption Creates a new global option.
cvtTimeout Converts SmartSockets second-based double timeouts to millisecond long timeouts.
exitFailure Exits with a message and a non-zero exit code.
exitSuccess Exits with a zero exit code. Convenience function to match exitFailure.
expect Test a condition for truth, prints a warning message if the it fails. Will optionally throw a TipcAssertionException as well if the ExpectAborts property is set.
fatal Prints a stack trace to the "standard" output stream, the text of the exception as a fatal error message, and exits with a non-zero exit code.
fromHexString Convert a String containing hex numbers into a byte array containing those binary values.
getOption Get a TipcOption.
getOptionBool Convenience method to get a boolean value from an option by name.
getOptionDouble Convenience method to get a double value from an option by name.
getOptionInt Convenience method to get an integer value from an option by name.
getOptionStr Convenience method to get a string value from a TipcOption by name.
getOut Gets the SmartSockets "standard" output stream.
guidToStr Converts a binary GUID into a printable String.
loadOptionsOverloaded. Loads options from the application configuration file. Loaded options override existing options with the same key. Note: If the options cannot be loaded, a warning is issued to the "Standard" output.
loadOptionsStream Loads options from an InputStream. Loaded options override existing options with the same key. Note: If the stream cannot be loaded, a warning is issued to the "Standard" output.
msgIdToStr Converts a binary message ID into a printable String.
Out Prints a message to the SmartSockets "standard" output stream.
removeOptionOverloaded. Removes a global option.
setOption Convenience method to set an option by name.
setOut Reassigns the SmartSockets "standard" output stream. Reassigning to null suppresses SmartSockets from printing to the output stream. The default is System.out.
sleep Sleeps for a period of time. This is a replacement for Thread.sleep(), which avoids a known problem with priorities and network connections, that makes Thread.sleep() hang a process forever. This method also follows the SmartSockets convention of using a double time in seconds, rather than a long in milliseconds.
strToGuid Converts a String formatted like the output of guidToStr and converts it to a binary GUID.
strToMsgId Converts a String formatted like the output of msgIdToStr and converts it to a binary message ID.
swapEight Swaps eight bytes in place.
swapFour Swaps four bytes in place.
swapTwo Swaps two bytes in place.
toHexString Returns a String containing the argument as two hex digits, using a leading zero, if necessary. Also doesn't do sign extension, as the JDK Integer method does.
warningOverloaded. Prints a warning message to the "standard" output stream.

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

Tut Class | TIBCO.SMARTSOCKETS Namespace | TipcOption | TipcConnClient


Copyright © TIBCO Software Inc. All rights reserved