#include <tsrv.h>
Inheritance diagram for SmartSockets::TipcSrv::
Public Methods | |
TipcSrv (const char *unique_subject, const char *server_names, const char *project=(const char *) T_NULL, const char *subject_prefix=(const char *) T_NULL) throw (TipcException) | |
TipcSrv (const char *name) throw (TipcException) | |
TipcSrv (T_IPC_SRV srv, bool destroyFlag=false) throw (TipcException) | |
operator T_IPC_CONN () throw (TipcException) | |
operator T_IPC_SRV () const throw (TipcException) | |
void | close (T_IPC_SRV_CONN_STATUS close_status=T_IPC_SRV_CONN_NONE) throw (TipcException) |
virtual | ~TipcSrv () throw () |
Destructor. | |
void | open (T_IPC_SRV_CONN_STATUS create_status=T_IPC_SRV_CONN_FULL) throw (TipcException) |
virtual bool | check (T_IO_CHECK_MODE check_mode, real8 timeout) throw (TipcException) |
virtual void | flush () throw (TipcException) |
virtual int4 | getAutoFlushSize () const throw (TipcException) |
virtual void | setAutoFlushSize (int4 auto_flush_size) throw (TipcException) |
virtual int4 | trafficGetBytesRecv () const throw (TipcException) |
virtual int8 | trafficGetBytesRecv8 () const throw (TipcException) |
virtual int4 | trafficGetBytesSent () const throw (TipcException) |
virtual int8 | trafficGetBytesSent8 () const throw (TipcException) |
virtual int4 | trafficGetMsgsRecv () const throw (TipcException) |
virtual int8 | trafficGetMsgsRecv8 () const throw (TipcException) |
virtual int4 | trafficGetMsgsSent () const throw (TipcException) |
virtual int8 | trafficGetMsgsSent8 () const throw (TipcException) |
virtual int4 | bufferGetReadSize () const throw (TipcException) |
virtual int4 | bufferGetWriteSize () const throw (TipcException) |
virtual real8 | getTimeout (T_IPC_TIMEOUT timeout) const throw (TipcException) |
virtual void | setTimeout (T_IPC_TIMEOUT timeout, real8 value) throw (TipcException) |
virtual sock | getSocket () const throw (TipcException) |
virtual int4 | getNumQueued () const throw (TipcException) |
virtual sock | getXtSource () const throw (TipcException) |
virtual void | setUsernamePassword (const char *username, const char *password) throw (TipcException) |
virtual void | keepAlive () throw (TipcException) |
virtual bool | mainLoop (real8 timeout) throw (TipcException) |
virtual void | insert (TipcMsg &msg, int4 pos=T_IPC_POS_PRIORITY) throw (TipcException) |
virtual void | next (TipcMsg &msg, real8 timeout) throw (TipcException) |
virtual bool | nextEx (TipcMsg &msg, real8 timeout) throw (TipcException) |
virtual void | process (TipcMsg &msg) throw (TipcException) |
virtual void | search (TipcMsg &msg, TipcConnSearchSelector *selObj, real8 timeout) throw (TipcException) |
virtual void | searchType (TipcMsg &msg, TipcMt &mt, real8 timeout) throw (TipcException) |
virtual void | read (real8 timeout) throw (TipcException) |
virtual void | send (const TipcMsg &msg, bool check_server_msg_send=true) throw (TipcException) |
virtual void | sendRpc (TipcMsg &reply_msg, const TipcMsg &call_msg, real8 timeout=T_TIMEOUT_FOREVER) throw (TipcException) |
virtual void | print (T_OUT_FUNC func=(T_OUT_FUNC) TutOut) const throw (TipcException) |
virtual const char * | getPeerUniqueSubject () const throw (TipcException) |
virtual const char * | getNode () const throw (TipcException) |
virtual const char * | getUser () const throw (TipcException) |
virtual int4 | getPid () const throw (TipcException) |
virtual const char * | getArch () const throw (TipcException) |
virtual T_IPC_SRV_CONN_STATUS | getStatus () const throw (TipcException) |
virtual void | lock () throw (TipcException) |
virtual void | unlock () throw (TipcException) |
virtual int4 | getGmdNumPending () const throw (TipcException) |
bool | getSubscribe (const char *subject) throw (TipcException) |
void | setSubscribe (const char *subject, bool recv_status=true) throw (TipcException) |
void | traverseSubscribe (TipcSrvSubjTraverser *travObj) throw (TipcException) |
void | setSubscribeStd (bool subscribe_status=true) throw (TipcException) |
bool | getSubscribeLb (const char *subject, bool *lb_status_return) throw (TipcException) |
void | setSubscribeLb (const char *subject, bool subject_status=true, bool lb_status=true) throw (TipcException) |
void | subjectLbInit (const char *subject) throw (TipcException) |
virtual void | gmdFileCreate () throw (TipcException) |
virtual void | gmdFileDelete () throw (TipcException) |
virtual void | gmdResend () throw (TipcException) |
virtual void | gmdMsgDelete (TipcMsg &msg) throw (TipcException) |
virtual uint4 | getGmdMaxSize () const throw (TipcException) |
virtual void | setGmdMaxSize (uint4 gmd_max_size) throw (TipcException) |
void | gmdMsgServerDelete (TipcMsg &msg) throw (TipcException) |
void | gmdMsgStatus (TipcMsg &msg) throw (TipcException) |
void | subjectGmdInit (const char *subject) throw (TipcException) |
void | setProject (const char *project) throw (TipcException) |
const char * | getProject () throw (TipcException) |
void | setServerNames (const char *server_names) throw (TipcException) |
void | setServerNamesList (T_STR_LIST server_names_list) throw (TipcException) |
T_STR_LIST | getServerNamesList () throw (TipcException) |
void | setDefaultSubjectPrefix (const char *default_subject_prefix) throw (TipcException) |
const char * | getDefaultSubjectPrefix () throw (TipcException) |
void | setUniqueSubject (const char *unique_subject) throw (TipcException) |
const char * | getUniqueSubject () throw (TipcException) |
void | setSubscribeCache (const char *subj_name, bool status, int4 flags) throw (TipcException) |
void | setCredentials (int4 auth_policy_id, void *auth_data, int4 auth_data_len) throw (TipcException) |
virtual CallBack< MessageQueueCallBack > * | queueCbCreate (const TipcMt &mt, MessageQueueCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< ConnectionCallBack > * | openCbCreate (ConnectionCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< ConnectionCallBack > * | closeCbCreate (ConnectionCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< ErrorCallBack > * | errorCbCreate (ErrorCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< MessageCallBack > * | encryptCbCreate (const TipcMt &mt, MessageCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< MessageCallBack > * | decryptCbCreate (const TipcMt &mt, MessageCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< MessageCallBack > * | defaultCbCreate (MessageCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< MessageCallBack > * | processCbCreate (const TipcMt &mt, MessageCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< MessageCallBack > * | readCbCreate (const TipcMt &mt, MessageCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< MessageCallBack > * | writeCbCreate (const TipcMt &mt, MessageCallBack *implementor, void *arg=NULL) throw (TipcException) |
virtual CallBack< MessageCallBack > * | subjectCbCreate (const char *subject, const TipcMt &mt, MessageCallBack *implementor, void *arg=NULL) throw (TipcException) |
void | write (const char *dest, TipcMt &mt, bool check_server_msg_send,...) throw (TipcException) |
void | writeVa (const char *dest, TipcMt &mt, bool check_server_msg_send, va_list var_arg_list) throw (TipcException) |
Static Public Methods | |
void | logAddMt (T_IPC_MT_LOG_TYPE log_type, TipcMt &mt) throw (TipcException) |
void | logRemoveMt (T_IPC_MT_LOG_TYPE log_type, TipcMt &mt) throw (TipcException) |
Static Protected Methods | |
void T_ENTRY1 | subjectCbDelegator (T_IPC_CONN connection, T_IPC_SRV_SUBJECT_CB_DATA data, T_CB_ARG arg) |
void T_ENTRY1 | openCbDelegator (T_IPC_SRV connection, T_IPC_SRV_OPEN_CB_DATA data, T_CB_ARG arg) |
void T_ENTRY1 | closeCbDelegator (T_IPC_SRV connection, T_IPC_SRV_CLOSE_CB_DATA data, T_CB_ARG arg) |
|
Creates a connection object but doesn't establish a connection. To establish a connection, please see TipcSrv::open().
|
|
Creates a "named" connection object. This connection will use "named" option values.
|
|
constructor from the C type T_IPC_SRV. This constructor is used internally by the API.
|
|
Gets the total number of bytes in a connection's read buffer.
Reimplemented from SmartSockets::TipcConn. |
|
Gets the total number of bytes in a connection's write buffer.
Reimplemented from SmartSockets::TipcConn. |
|
Checks if data can be read from or written to connection. This is a low level method that is only used in advanced publish and subscribe applications. This method is normally called by flush() and read().
Reimplemented from SmartSockets::TipcConn. |
|
Closes a connection. There are two ways to close the connection to RTserver. A full closure removes all the connection's RTserver-related information. Once this has occurred, the connection can continue as if it had never been connected at all to RTserver. The other mode of close is a warm closure. A warm closure keeps as much RTserver-related information as possible. Once this has occurred, the connection can easily reconnect to RTserver in the future and pick up where it left off. After a warm destroy, the connection can even partially operate as if it were still connected to RTserver. Messages can be sent, and they are buffered until a full connection to RTserver is created again.
|
|
Creates a close connection callback. Close callbacks are called when this object either loses or explicitly closes a connection to RTserver.
|
|
Delegator method for close connection callbacks. Will be called when the callback is triggered and will in turn call the callback's handler method.
|
|
Creates a callback that is called after all the read callback objects are called and after the TipcMtEncrypt object is called. The Decrypt callback objects are called when a new message is read from the connection's socket, which occurs in the read(). First, the read callbacks are called. Then the message is decrypted. Finally, the decrypt callbacks are called. Decrypt callbacks are useful for processing messages, after they have been decrypted, to do the exact opposite of what was done during the encrypt callbacks. A decrypt callback is usually created for a specific message type and connection. If the message type is null, then global decrypt callback is created for all message types on that connection.
Reimplemented from SmartSockets::TipcConn. |
|
Creates a default callback that is invoked if no other process callbacks are called. Default callback objects are called by process() when there are no process callbacks for the type of message being processed. Default callbacks are useful for processing unexpected message types or for generic processing of most message types.
Reimplemented from SmartSockets::TipcConn. |
|
Creates a callback that is invoked before the TipcMtEncrypt encryption callbacks and before the write callbacks are invoked. EncryptionCallBack objects are invoked when a message is buffered to be sent through the connection's socket, which occurs in send(). These objects are invoked before the write callback objects are invoked. After these objects are invoked, the message is encrypted using the encryption object registered by TipcMt::setEncryptObj() and then the write callbacks are invoked. Encrypt callbacks are useful for processing of messages before they are encrypted and sent. An encrypt callback is usually created for a specific message type and connection. If the message type is null (e.g. TipcMt nullMt((T_IPC_MT)NULL);), then global encrypt callback is created for all message types on that connection.
Reimplemented from SmartSockets::TipcConn. |
|
Creates an error callback. ErrorCallBack objects are invoked whenever this object loses a connection to RTserver.
Reimplemented from SmartSockets::TipcConn. |
|
Flushes buffered outgoing messages on the connection.
Reimplemented from SmartSockets::TipcConn. |
|
Determine the architecture name of the connected server. The string returned is equivalent to the value of the environment variable RTARCH in the machine where the RTserver is used (e.g. sun4_solaris on Solaris, i86_w32 on Intel Windows 32 boxes).
Reimplemented from SmartSockets::TipcConn. |
|
Gets the auto_flush_size of a connection to the RTserver. The auto flush size is used to control how much outgoing data (in bytes) are buffered before being automatically flushed to RTserver. The default for the auto flush size is 8192 bytes.
Reimplemented from SmartSockets::TipcConn. |
|
Get the connections default subject prefix return the default subject prefix of the connection
|
|
Gets the GMD area's maximum size of the connection to RTserver. A GMD area holds guaranteed message delivery information for both incoming and outgoing messages. There are two types of guaranteed message delivery: file-based GMD and memory-only GMD. For file-based GMD this limit is the maximum file size, and for memory-only GMD this limit is the maximum amount of memory allowed. The default GMD area maximum size is 0, which means that no GMD area maximum size limit checking is performed. The connection GMD area maximum size and the connection delivery timeout can be used to constrain the amount of system resources used for GMD by space and by time. If the connection GMD area maximum size is exceeded, then no further messages can be sent with guaranteed delivery (send() throws an exception with the SmartSockets error number to set to T_ERR_VAL_TOO_LARGE) until some unacknowledged previously sent messages are acknowledged.
Reimplemented from SmartSockets::TipcConn. |
|
Determines the number of outgoing GMD messages still pending on the connection. This method gets the number of GMD messages published to RTserver that have not been acknowledged nor explicitly deleted from the GMD area. Messages are deleted from the GMD area when a GMD_ACK message is received and when a GMD_FAILURE message is processed. TipcSrvGetGmdNumPending may attempt to automatically create a connection to RTserver. If the connection's state is warm, this method gets the number of pending GMD messages from the warm connection.
Reimplemented from SmartSockets::TipcConn. |
|
Determines the node name of the connected server.
Reimplemented from SmartSockets::TipcConn. |
|
Gets the number of queued messages from the connection. A connection has a priority queue of incoming messages. Messages are inserted into the queue either explicitly or implicitly. Explicit insertions can be made by calling the insert() method. Implicit insertions happen whenever data is read using the read() or next() methods.
Reimplemented from SmartSockets::TipcConn. |
|
Determines the unique subject of the connected server.
Reimplemented from SmartSockets::TipcConn. |
|
Determines the process ID of the connected server.
Reimplemented from SmartSockets::TipcConn. |
|
Get the connections project.
|
|
Get the connections server names list.
|
|
Gets the socket handle of the connection. A socket is an operating system device which provides a communication link to another process. All data sent to and received from the connection is transmitted on this socket.
Reimplemented from SmartSockets::TipcConn. |
|
Determines the status of the connection. A connection status of T_IPC_SRV_CONN_FULL indicates that the connection has been opened to RTserver. A connection status of T_IPC_SRV_CONN_WARM indicates that the connection has a warm state. connection to RTserver. A connection status of T_IPC_SRV_CONN_NONE indicates that the TipcSrv object does not have a connection to RTserver.
|
|
Determines if this object is subscribing to a subject. The subscribe status controls whether the RTclient receives messages published (sent) to that subject. If the subscribe status of subject is true, the connection receives messages with subject as their destination that are sent to RTserver. To start or stop subscribing to a subject, use setSubscribe(). To find out if this connection is subscribing to a subject including load balancing information, use getSubscribeLb().
|
|
Determines if a connection is subscribing to a subject, including load balancing information.
|
|
Gets a timeout property from the connection to RTserver. The timeout properties control how often (in seconds) the connection to RTserver is checked for possible network failures. The timeout properties of the connection to RTserver are also available in the options Server_Read_Timeout, Server_Write_Timeout, Server_Keep_Alive_Timeout, and Server_Delivery_Timeout. For the connection to RTserver, the default read timeout is 30.0 seconds, the default write timeout is 30.0 seconds, the default keep alive timeout is 15.0 seconds, and the default delivery timeout is 30.0 seconds.
Reimplemented from SmartSockets::TipcConn. |
|
Get the connections unique subject.
|
|
Determines the user name of the connected server.
Reimplemented from SmartSockets::TipcConn. |
|
Gets an XtAppAddInput-compatible source from a connection, which allows SmartSockets connections to be mixed with Motif or any other Xt-based widget set. Both Xt and TipcSrv have their own main loop functions: XtAppMainLoop for Xt and mainLoop() for TipcSrv. Since only one main loop function can be used, it is easiest to use XtAppAddInput for incorporating other sources of input into Xt's event- handling mechanism. See the SmartSockets User's Guide for more information on integrating SmartSockets with Motif/Xt.
Reimplemented from SmartSockets::TipcConn. |
|
Creates a guaranteed message delivery (GMD) area on the connection to RTserver. This is a low level method that is automatically called from open() if a GMD areal doesn't exist; only advanced applications that want to speed up the connection process should call this.
Reimplemented from SmartSockets::TipcConn. |
|
Deletes from disk guaranteed message delivery (GMD) files for a connection. TipcConnGmdFileDelete is useful for processes that wish to completely delete any obsolete GMD information. When a process using GMD creates a connection, one of two scenarios is possible:
Reimplemented from SmartSockets::TipcConn. |
|
Deletes a message from the local GMD area after a GMD failure on the connection to RTserver. This method is was intended to be used from a GMD_FAILURE connection process callback to terminate GMD for the message. When a GMD_FAILURE message is processed by a sender RTclient, one of two scenarios is possible:
Reimplemented from SmartSockets::TipcConn. |
|
Deletes a message in RTserver after a GMD failure on the connection to RTserver. This method sends a GMD_DELETE message to RTserver. When RTserver routes a message for GMD, it keeps the message in memory so that it can easily and quickly resend the message to any receiving RTclient that disconnects and reconnects. This method informs RTserver to terminate GMD for the message, which allows RTserver to reclaim the memory for the message. This method is intended to be used from a GMD_FAILURE connection process callback to terminate GMD for the message. When a GMD_FAILURE message is processed by a sender RTclient, one of two scenarios is possible:
|
|
Polls RTserver for GMD status of a message. This method polls for the GMD status of msg by sending a GMD_STATUS_CALL message to RTserver. RTserver responds by sending back a GMD_STATUS_RESULT message. The response should come back very quickly. The polling RTclient can use functions such as searchType() to get the response. When RTserver routes a message for GMD, it keeps track of which RTclients should receive the message and the status of GMD to each of these RTclients. gmdMsgStatus() is intended to be used from a GMD_FAILURE connection process callback to query GMD status for the message. The GMD_STATUS_RESULT message contains four fields:
|
|
Resends all guaranteed messages after a delivery failure on the connection to RTserver.
Reimplemented from SmartSockets::TipcConn. |
|
Inserts a message into the queue of the connection.
Reimplemented from SmartSockets::TipcConn. |
|
Checks if the server connection is still alive. This method performs a remote procedure call to check if the process at the other end of a connection is still alive. This explicit attempt to check the health of a connection is called a keep alive. keepAlive() is normally used only by checki(), which automatically checks the connection based on the read timeout property of the connection. keepAlive() can be called explicitly, though, to check the health of the connection. If the other end of the connection is alive, it receives the KEEP_ALIVE_CALL message, processes it with TipcCbConnProcessKeepAliveCall, and sends a KEEP_ALIVE_RESULT message back to this end.
Reimplemented from SmartSockets::TipcConn. |
|
Acquires exclusive access to the connection. This method locks all of the internal synchronization objects within the connection to RTserver. This insures that the calling thread in a multi-threaded process has exclusive access to the connection to RTserver. lock() may be called by a thread recursively.
Reimplemented from SmartSockets::TipcConn. |
|
Adds a message type to a message file logging type on the connection to RTserver. Each logging type has two options that can be used to log incoming and outgoing messages in that logging type. When the option is set (the option value should be the name of a file), then read callbacks (for incoming) or write callbacks (for outgoing) are created for all the logging type's message types in the connection to RTserver. More than one option can use the same file:
|
|
Removes a message type from a message file logging type on the connection to RTserver. Each logging type has two options that can be used to log incoming and outgoing messages in that logging type. When the option is set (the option value should be the name of a file), then read callbacks (for incoming) or write callbacks (for outgoing) are created for all the logging type's message types in the connection to RTserver. More than one option can use the same file:
|
|
Reads and processes messages on a connection. This method is a convenience function that keeps calling TipcConnMsgNext with the time remaining from timeout until next() throws an exception or times out. For each TipcMsg that mainLoop() gets, it processes the message with process() and then destroys the message.
Reimplemented from SmartSockets::TipcConn. |
|
Retrieves the next message from the connection.
Reimplemented from SmartSockets::TipcConn. |
|
Retrieves the next message from the connection.
Reimplemented from SmartSockets::TipcConn. |
|
Opens a connection. A connection can be openned as a full connection or as a warm connection. A full connection allows the application to send or receive SmartSockets TipcMsg objects. A warm connection allows clients to buffer TipcMsg objects in memory before a full connection is established.
|
|
Creates an open connection callback. Open callbacks are called when this object creates a warm or full connection to RTserver.
|
|
Delegator method for open connection callbacks. Will be called when the callback is triggered and will in turn call the callback's handler method.
|
|
Gets the C style T_IPC_CONN handle to the connection. Note that a valid T_IPC_CONN is only returned if a connection has been opened.
|
|
Gets the C style T_IPC_SRV handle to the connection.
|
|
Prints information about the connection to standard out. The output can also be redirected if the parameter func is passed
Reimplemented from SmartSockets::TipcConn. |
|
Processes a message in a connection by calling the process, subject or default callbacks. The default callbacks are only called if there are no non-global process callbacks for the type of message being processed. Processing a message with two levels of callbacks allows for more flexibility. For example, RTserver creates a few process callbacks for the message types it needs to process locally (such as SUBJECT_SET_SUBSCRIBE), but the majority of the message types (such as NUMERIC_DATA) are simply routed to their destination by a default callback. Any message can be processed by process(), not just messages read from a connection. For example, a generic message file data source could be implemented using the extractor operator to read messages from a file then the messages created can be processed by calling process().
Reimplemented from SmartSockets::TipcConn. |
|
Creates a process callback that is triggered after a call to process(). Process callback objects are triggered by a call to process() to perform the normal processing of a message, such as storing numeric data values and then acting on the variables. A process callback is usually created for a specific message type and connection. If the message type is null (TipcMt nullMt((T_IPC_MT)NULL);), then a global process callback is created for all message types on that connection.
Reimplemented from SmartSockets::TipcConn. |
|
Creates a message queue callback. Queue callbacks are called when a message is inserted into or deleted from a connection's queue of incoming messages. Queue callbacks are useful for watching the messages that have been read in by a connection, but not yet processed. There is some overlap between read callbacks and queue callbacks. A queue callback is usually created for a specific message type and connection. If the message type is null (e.g. TipcMt nullMt((T_IPC_MT)NULL), then a global queue callback is created for all message types on that connection.
Reimplemented from SmartSockets::TipcConn. |
|
Reads all available data from the connection to RTserver and queues messages in priority order. If the connection's auto flush size is not T_IPC_NO_AUTO_FLUSH, then read() first calls flush() to flush the connection's write buffer (so that any responses to the outgoing data are available sooner). read() then reads data (in the form of message packets) from a connection's socket and calls the connection decode callbacks. If necessary, the integers and strings in the message header are converted to the formats used by the receiving process. read() then converts the message packets into messages, and calls the connection's read callbacks. read() returns as soon as at least one message is read, so that high-data-rate applications do not sit forever reading data.
Reimplemented from SmartSockets::TipcConn. |
|
Creates a read callback. Read callback objects are called when a new message is received from the connection's socket, which occurs whenever read() is called. Connection read callbacks are useful for message file logging and preprocessing of messages before the normal processing with process(). A read callback is usually created for a specific message type and connection. If the message type is null (e.g. TipcMt nullMt((T_IPC_MT) NULL) ), then a global read callback is created for all message types on that connection.
Reimplemented from SmartSockets::TipcConn. |
|
Searches the message queue of the connection for a specific message. The connection has a priority queue of incoming messages. This method traverses the messages in this internal priority queue calling the TipcConnSearchSelector object's onSearch() method until either TipcConnSearchSelector::onSearch() returns true, or the timeout period expires. If TipcConnSearchSelector::onSearch() returns true, the message is removed from the queue and put into the msg parameter. If the end of the queue is reached, read() is called with the remaining timeout. If any new messages arrive, the queue is traversed again.
Reimplemented from SmartSockets::TipcConn. |
|
Searches the message queue of the connection for a message with a specific type. This is a convenience method that uses the same technique as search() with a specific selector object that looks for messages of a particular type.
Reimplemented from SmartSockets::TipcConn. |
|
Sends a TipcMsg through the connection. If check_server_msg_send is set to true and the option Server_Msg_Send is false, then send() does not send the message, but returns immediately. Otherwise send() first temporarily sets the sender of the message (using the value of the option Unique_Subject), then temporarily prepends the value of the option Default_Subject_Prefix to the message sender and destination if they do not start with slash (/), and calls the appropriate write callbacks. If the message has a delivery mode of either T_IPC_DELIVERY_SOME or T_IPC_DELIVERY_ALL, then TipcConnMsgSend performs some extra steps for guaranteed message delivery. If the connection does not have a GMD area open, then send() calls gmdFileCreate() to create the necessary GMD area. send() increments an internal per-connection sequence number, sets the sequence number of the message to the incremented value, and then saves a copy of the message to the GMD area so that the message can be easily resent. With file-based GMD, recovery can take place even if this process crashes and has to be restarted. If the message delivery timeout property is not set, then the connection delivery timeout value is used for GMD. send() then converts the message into a message packet (checking the message header string encode property to see if header strings should be encoded as integers to save space), executes the connection encode callbacks, and appends the message packet to the connection's write buffer. TipcConnMsgSend then calls TipcConnFlush if the number of bytes in the connection's write buffer is greater than the connection's auto flush size.
Reimplemented from SmartSockets::TipcConn. |
|
Makes a remote procedure call (RPC) with TipcMsg objects. One message is sent as the RPC call from the caller end of the connection, and another message is sent back as the RPC result to the caller. The callee end of the connection must be prepared to receive the call message and send back the result message. The relationship between the call and result message is that the message type number of the result message is always one greater than the message type number of the call message. sendRpc() sends the message with send(), flushes all pending outgoing data with flush(), and then waits for the result with searchType().
Reimplemented from SmartSockets::TipcConn. |
|
Sets the auto_flush_size of a connection to the RTserver. The auto flush size is used to control how much outgoing data (in bytes) are buffered before being automatically flushed to RTserver. The default for the auto flush size is 8192 bytes. If set to T_IPC_NO_AUTO_FLUSH, data will never be flushed.
Reimplemented from SmartSockets::TipcConn. |
|
Sets the connection's credentials. This method allows any credential mechanisms (e.g. Kerberos, certificates, user name and password, etc.) to be used to authenticate a client application before it joins an RTserver cloud. The data used here will be passed to the appropriate Security manager in place, and it's up to that process to grant or deny access to the RTserver cloud.
|
|
Set the connections default subject prefix.
|
|
Sets the GMD area's maximum size of the connection to RTserver. A GMD area holds guaranteed message delivery information for both incoming and outgoing messages. There are two types of guaranteed message delivery: file-based GMD and memory-only GMD. For file-based GMD this limit is the maximum file size, and for memory-only GMD this limit is the maximum amount of memory allowed. The default GMD area maximum size is 0, which means that no GMD area maximum size limit checking is performed. The connection GMD area maximum size and the connection delivery timeout can be used to constrain the amount of system resources used for GMD by space and by time. If the connection GMD area maximum size is exceeded, then no further messages can be sent with guaranteed delivery (send() throws an exception with the SmartSockets error number to set to T_ERR_VAL_TOO_LARGE) until some unacknowledged previously sent messages are acknowledged.
Reimplemented from SmartSockets::TipcConn. |
|
Set the connections project.
|
|
Set the connections server names. This may be a comma delimited list of server names.
|
|
Get the connections server names.
|
|
Starts or stops subscribing to a subject. This method sets whether or not this object is subscribing to a subject. The subscribe status controls whether or not the connection receives messages published (sent) to that subject. If the subscribe status of subject is true, then the connection receives messages with subject as their destination that are sent to RTserver. To determine if an connection is subscribing to a subject, use getSubscribe().
|
|
Subscribes to a subject obtaining the last cached value from SmartCache. See SmartCache's documentation for more information on how to use this method.
|
|
Starts or stops subscribing to a subject, with or without load balancing.
|
|
Starts or stops subscribing to all standard subjects. This method sets the subscribe status of the standard subjects by calling setSubscribe() for each standard subject. setSubscribe() is often used to subscribe to subjects listed in a command file (e.g. if a command file has the following: setopt subjects "/foo", "/bar"). The following are standard subjects:
|
|
Sets a timeout property from the connection to RTserver. The timeout properties control how often (in seconds) the connection to RTserver is checked for possible network failures. The timeout properties of the connection to RTserver are also available in the options Server_Read_Timeout, Server_Write_Timeout, Server_Keep_Alive_Timeout, and Server_Delivery_Timeout. For the connection to RTserver, the default read timeout is 30.0 seconds, the default write timeout is 30.0 seconds, the default keep alive timeout is 15.0 seconds, and the default delivery timeout is 30.0 seconds.
Reimplemented from SmartSockets::TipcConn. |
|
Set the connections unique subject.
|
|
Sets the username and password for the RTclient when connecting to an RTserver with the Basic Security Driver installed. The password is immediately encrypted and is never sent in plain text to the RTserver.
|
|
Creates a subject callback. Subject callback objects are called by a call to process() to process a message when it is received by the subject. If subject is null, then func is called for all messages of type mt received by this connection. If mt is null, then the MessageCallBack object is called for every type of message received by subj. If both subject and mt are null (TipcMt nullMt((T_IPC_MT)NULL);), the MessageCallBack object is called for every message received by this connection. Subject wildcards (* or ...) are supported.
|
|
Delegator method for subject callbacks. Will be called when the callback is triggered and will in turn call the callback's handler method.
|
|
Initializes GMD accounting in RTserver for a subject to which messages will be published.
|
|
Initializes load balancing accounting in RTserver for a subject to which messages will be published. When the RTserver connected to the publishing connection routes a message for load balancing, it keeps track of which connection should receive the message. If this RTserver is not already tracking load balancing for subject when the first published message arrives from a connection, the RTserver must start a monitoring-like watch mechanism between the RTservers of all subscribing connections. This increases the scalability of load balancing because only the relevant RTservers dynamically exchange load balancing information. The load balancing accounting continues until no messages have been published with GMD or load balancing for an interval specified by the Gmd_Publish_Timeout option. The default for Gmd_Publish_Timeout is 300 seconds. The starting of this load balancing accounting is very fast but not instantaneous. TipcSrvSubjectLbInit is intended to be used by advanced publish- subscribe applications that wish to ensure that RTserver is primed and immediately ready for load balancing publish-subscribe routing. TipcSrvSubjectLbInit is usually only used at initialization, but it can be called at any time by advanced applications which wish to initialize load balancing publishing accounting. The use of TipcSrvSubjectLbInit is strictly optional for load balancing publishing; if it is not called the load balancing setup occurs when the first GMD or load balancing message is published to subject. If RTserver is already tracking load balancing for subject, RTserver immediately returns a GMD_INIT_RESULT message.
|
|
Gets the total number of bytes received on a connection.
Reimplemented from SmartSockets::TipcConn. |
|
Gets the total number of bytes received on a connection.
Reimplemented from SmartSockets::TipcConn. |
|
Gets the total number of bytes written to the write buffer on a connection. This number usually is the same as the total number of bytes actually sent on the connection, but sometimes the retrieved number is larger than the number of bytes sent when the write buffer is not frequently flushed.
Reimplemented from SmartSockets::TipcConn. |
|
Gets the total number of bytes written to the write buffer on a connection. This number usually is the same as the total number of bytes actually sent on the connection, but sometimes the retrieved number is larger than the number of bytes sent when the write buffer is not frequently flushed.
Reimplemented from SmartSockets::TipcConn. |
|
Gets the total number of messages received on a connection.
Reimplemented from SmartSockets::TipcConn. |
|
Gets the total number of messages received on a connection.
Reimplemented from SmartSockets::TipcConn. |
|
Gets the total number of messages written to the write buffer on a connection. This number usually is the same as the total number of messages actually sent on the connection, but sometimes the retrieved number is larger than the number of messages sent when the write buffer is not frequently flushed.
Reimplemented from SmartSockets::TipcConn. |
|
Gets the total number of messages written to the write buffer on a connection. This number usually is the same as the total number of messages actually sent on the connection, but sometimes the retrieved number is larger than the number of messages sent when the write buffer is not frequently flushed.
Reimplemented from SmartSockets::TipcConn. |
|
Traverses the list of subjects that connection is subscribing. This method invokes the TipcSrvSubjTraverser::onTraverse() method for each entry in the subscription table, until either TipcSrvSubjTraverser::onTraverse() returns false, or the table ends.
|
|
Releases exclusive access to the connection. This method unlocks all of the internal synchronization objects within the connection to RTserver.
Reimplemented from SmartSockets::TipcConn. |
|
Constructs a message and sends it through the connection. This is a convenience method that takes a null-terminated variable number of field type-value pairs. The field type part of the pair is T_IPC_FT, and the value part of the pair corresponds to the arguments for the related TipcMsg::append() methods (e.g. if the type is T_IPC_FT_REAL8, then the value part is a * REAL8 number) or TipcMsg::set* methods (if the type part is T_IPC_PROP_DELIVERY_MODE, then the value part is a T_IPC_DELIVERY_MODE setting). Some field types, such as arrays, use two arguments for the value part. Write() performs the following steps:
|
|
Creates a write callback. Write callback objects are called when a message is buffered to be sent through a connection's socket, which occurs when send() is called. Connection write callbacks are useful for message file logging and processing of messages before they are actually sent. A write callback is usually created for a specific message type and connection. If the message type is null, then a global write callback is created for all message types on that connection.
Reimplemented from SmartSockets::TipcConn. |