TipcSrv


Name

TipcSrv — user class representing the RTclient functionality (corresponding to the TipcSrv* API functions)

Synopsis

static TipcSrv& Instance(); 
static TipcSrv& InstanceCreate(); 
static TipcSrv& InstanceCreate(create_status); 

Inheritance

Description

The TipcSrv class provides a C++ interface to the TipcSrv* functions in SmartSockets.

The TipcSrv constructor is protected because in SmartSockets you cannot have more than one RTserver connection per process. Therefore, you are not allowed to construct a TipcSrv instance directly. If this is attempted, the corresponding C++ code does not pass compilation. However, you still need to be able to get a handle to a TipcSrv instance in order to call the TipcSrv* versions of TipcConn* virtual functions inherited from the TipcConn class, and you still need to be able to cause TipcSrvCreate() to be called by some mechanism. For the underlying C function TipcSrvCreate() to be called, you should instead call the static TipcSrv class function InstanceCreate() or Instance(), the difference between these functions being whether TipcSrvCreate gets called or not as a side effect. Because C++ doesn't allow arguments to destructors, the TipcSrv class offers a Destroy() method to let you specify a SmartSockets destroy status. When TipcSrv is destroyed automatically (for example, Destroy() isn’t called, and the TipcSrv reference obtained through Instance() passes out of scope), the T_IPC_SRV_CONN_NONE destroy status is set by default.

Caution

None

See Also

TipcConn

Public Member Functions

TipcSrv::Arch

Syntax:
virtual T_STR Arch(); 
Remarks:
Get the architecture name of the connected RTserver.
C API:
TipcSrvGetArch

TipcSrv::AutoFlushSize

Syntax:
virtual T_INT4 AutoFlushSize(); 
Remarks:
Get the automatic flush size of a connection to RTserver.
C API:
TipcSrvGetAutoFlushSize
 
  
Syntax:
virtual T_BOOL AutoFlushSize(T_INT4 auto_flush_size); 
Remarks:
Set the automatic flush size of a connection to RTserver.
C API:
TipcSrvSetAutoFlushSize

TipcSrv::BlockMode

Syntax:
virtual T_BOOL BlockMode(); 
Remarks:
Get the block mode of the connection to RTserver.
C API:
TipcSrvGetBlockMode
 
  
Syntax:
virtual T_BOOL BlockMode(T_BOOL block_mode); 
Remarks:
Set the block mode of the connection to RTserver.
C API:
TipcSrvSetBlockMode

TipcSrv::Check

Syntax:
virtual T_BOOL Check(T_IO_CHECK_MODE check_mode,  
                     T_REAL8 timeout); 
Remarks:
Check if data can be read from or written to the connection to RTserver.
C API:
TipcSrvCheck

TipcSrv::ConnStatus

Syntax:
T_IPC_SRV_CONN_STATUS ConnStatus(); 
Remarks:
Get the status of the connection to RTserver.
C API:
TipcSrvGetConnStatus

TipcSrv::Create

Syntax:
T_BOOL Create(T_IPC_SRV_CONN_STATUS create_status); 
Remarks:
Create the connection to RTserver.
C API:
TipcSrvCreate

TipcSrv::DefaultCbCreate

Syntax:
virtual T_CB  
DefaultCbCreate(T_IPC_CONN_DEFAULT_CB_FUNC func, 
                T_CB_ARG arg); 
Remarks:
Create a default callback in the connection to RTserver.
C API:
TipcSrvDefaultCbCreate

TipcSrv::DefaultCbLookup

Syntax:
virtual T_CB  
DefaultCbLookup(T_IPC_CONN_DEFAULT_CB_FUNC func, 
                T_CB_ARG arg); 
Remarks:
Look up a default callback in the connection to RTserver.
C API:
TipcSrvDefaultCbLookup

TipcSrv::ErrorCbCreate

Syntax:
virtual T_CB ErrorCbCreate(T_IPC_CONN_ERROR_CB_FUNC func, 
                           T_CB_ARG arg); 
Remarks:
Create an error callback in the connection to RTserver.
C API:
TipcSrvErrorCbCreate

TipcSrv::ErrorCbLookup

Syntax:
virtual T_CB ErrorCbLookup(T_IPC_CONN_ERROR_CB_FUNC func, 
                           T_CB_ARG arg); 
Remarks:
Look up an error callback in the connection to RTserver.
C API:
TipcSrvErrorCbLookup

TipcSrv::Flush

Syntax:
virtual T_BOOL Flush(); 
Remarks:
Flush buffered outgoing messages on the connection to RTserver.
C API:
TipcSrvFlush

TipcSrv::GmdFileCreate

Syntax:
virtual T_BOOL GmdFileCreate(); 
Remarks:
Create guaranteed message delivery area on the connection to RTserver.
C API:
TipcSrvGmdFileCreate

TipcSrv::GmdFileDelete

Syntax:
virtual T_BOOL GmdFileDelete(); 
Remarks:
Delete guaranteed message delivery files for the connection to RTserver.
C API:
TipcSrvGmdFileDelete

TipcSrv::GmdMaxSize

Syntax:
T_UINT4 GmdMaxSize(); 
Remarks:
Get the GMD area maximum size of the connection to RTserver.
C API:
TipcSrvGetGmdMaxSize
 
  
Syntax:
T_BOOL GmdMaxSize(T_UINT4 gmd_max_size); 
Remarks:
Set the GMD area maximum size of the connection to RTserver.
C API:
TipcSrvSetGmdMaxSize

TipcSrv::GmdMsgDelete

Syntax:
T_BOOL GmdMsgDelete(TipcMsg& msg); 
Remarks:
Delete a message from the GMD area after a GMD failure on the connection to RTserver.
C API:
TipcSrvGmdMsgDelete

TipcSrv::GmdMsgResend

Syntax:
T_BOOL GmdMsgResend(TipcMsg& msg); 
Remarks:
Resend a message after a GMD failure on the connection to RTserver.
C API:
TipcSrvGmdMsgResend

TipcSrv::GmdMsgServerDelete

Syntax:
T_BOOL GmdMsgServerDelete(TipcMsg& msg); 
Remarks:
Delete a message in RTserver after a GMD failure on the connection to RTserver.
C API:
TipcSrvGmdMsgServerDelete

TipcSrv::GmdMsgStatus

Syntax:
T_BOOL GmdMsgStatus(TipcMsg& msg); 
Remarks:
Poll RTserver for GMD status of a message.
C API:
TipcSrvGmdMsgStatus

TipcSrv::GmdNumPending

Syntax:
T_INT4 GmdNumPending(); 
Remarks:
Get the number of guaranteed messages pending on connection to RTserver.
C API:
TipcSrvGetGmdNumPending

TipcSrv::GmdResend

Syntax:
virtual T_BOOL GmdResend(); 
Remarks:
Resend all guaranteed messages after a delivery failure on the connection to RTserver.
C API:
TipcSrvGmdResend

TipcSrv::Insert

Syntax:
virtual T_BOOL Insert(TipcMsg& msg, T_INT4 pos); 
Remarks:
Insert a message into queue of the connection to RTserver.
C API:
TipcSrvMsgInsert

TipcSrv::KeepAlive

Syntax:
virtual T_BOOL KeepAlive(); 
Remarks:
Check if the connection to RTserver is still alive.
C API:
TipcSrvKeepAlive

TipcSrv::Lock

Syntax:
virtual T_BOOL Lock(); 
Remarks:
Acquire exclusive access to the connection to RTserver.
C API:
TipcSrvLock

TipcSrv::MainLoop

Syntax:
virtual T_BOOL MainLoop(T_REAL8 timeout); 
Remarks:
Read and process messages on the connection to RTserver.
C API:
TipcSrvMainLoop

TipcSrv::Next

Syntax:
virtual TipcMsg& Next(T_REAL8 timeout); 
Remarks:
Get the next message from the connection to RTserver.
C API:
TipcSrvMsgNext

TipcSrv::Node

Syntax:
virtual T_STR Node(); 
Remarks:
Get the node name of the connected RTserver.
C API:
TipcSrvGetNode

TipcSrv::NumQueued

Syntax:
virtual T_INT4 NumQueued(); 
Remarks:
Get number of queued messages from the connection to RTserver.
C API:
TipcSrvGetNumQueued

TipcSrv::Pid

Syntax:
virtual Pid(); 
Remarks:
Get the process ID of the connected RTserver.
C API:
TipcSrvGetPid

TipcSrv::Print

Syntax:
virtual Print(T_OUT_FUNC func); 
Remarks:
Print all information about the connection to RTserver.
C API:
TipcSrvPrint

TipcSrv::Process

Syntax:
virtual T_BOOL Process(TipcMsg& msg); 
Remarks:
Process a message in the connection to RTserver.
C API:
TipcSrvMsgProcess

TipcSrv::ProcessCbCreate

Syntax:
virtual T_CB ProcessCbCreate(TipcMt& mt,  
                        T_IPC_CONN_PROCESS_CB_FUNC func, 
                        T_CB_ARG arg); 
Remarks:
Create a process callback in the connection to RTserver.
C API:
TipcSrvProcessCbCreate

TipcSrv::ProcessCbLookup

Syntax:
virtual T_CB ProcessCbLookup(TipcMt& mt,  
                        T_IPC_CONN_PROCESS_CB_FUNC func, 
                        T_CB_ARG arg); 
Remarks:
Look up a process callback in the connection to RTserver.
C API:
TipcSrvProcessCbLookup

TipcSrv::QueueCbCreate

Syntax:
virtual T_CB QueueCbCreate(TipcMt& mt, 
                           T_IPC_CONN_QUEUE_CB_FUNC func,  
                           T_CB_ARG arg); 
Remarks:
Create a queue callback in the connection to RTserver.
C API:
TipcSrvQueueCbCreate

TipcSrv::QueueCbLookup

Syntax:
virtual T_CB QueueCbLookup(TipcMt& mt, 
                           T_IPC_CONN_QUEUE_CB_FUNC func, 
                           T_CB_ARG arg); 
Remarks:
Look up a queue callback in the connection to RTserver.
C API:
TipcSrvQueueCbLookup

TipcSrv::Read

Syntax:
virtual T_BOOL Read(T_REAL8 timeout); 
Remarks:
Read all available data from the connection to RTserver and queue messages in priority order.
C API:
TipcSrvRead

TipcSrv::ReadCbCreate

Syntax:
virtual T_CB ReadCbCreate(TipcMt& mt,  
                          T_IPC_CONN_READ_CB_FUNC func, 
                          T_CB_ARG arg); 
Remarks:
Create a read callback in the connection to RTserver.
C API:
TipcSrvReadCbCreate

TipcSrv::ReadCbLookup

Syntax:
virtual T_CB ReadCbLookup(TipcMt& mt,  
                          T_IPC_CONN_READ_CB_FUNC func, 
                          T_CB_ARG arg); 
Remarks:
Look up a read callback in the connection to RTserver.
C API:
TipcSrvReadCbLookup

TipcSrv::Search

Syntax:
virtual TipcMsg& Search(T_REAL8 timeout,  
                        T_IPC_CONN_MSG_SEARCH_FUNC func,  
                        T_PTR arg); 
Remarks:
Search the message queue of the connection to RTserver for a specific message.
C API:
TipcSrvMsgSearch

TipcSrv::SearchType

Syntax:
virtual TipcMsg& SearchType(T_REAL8 timeout, TipcMt& mt); 
Remarks:
Search the message queue of the connection to RTserver for a message with a specific type.
C API:
TipcSrvMsgSearchType

TipcSrv::Send

Syntax:
virtual T_BOOL Send(TipcMsg& msg, 
                    T_BOOL check_server_msg_send = FALSE); 
Remarks:
Send a message through the connection to RTserver.
C API:
TipcSrvMsgSend

TipcSrv::SendRpc

Syntax:
virtual TipcMsg& SendRpc(TipcMsg& call_msg, T_REAL8 timeout); 
Remarks:
Make a remote procedure call (RPC) with a message on the connection to RTserver.
C API:
TipcSrvMsgSendRpc

TipcSrv::Socket

Syntax:
virtual T_INT4 Socket(); 
Remarks:
Get the socket of the connection to RTserver.
C API:
TipcSrvGetSocket
 
  
Syntax:
virtual T_BOOL Socket(T_INT4 socket); 
Remarks:
Set the socket of the connection to RTserver.
C API:
TipcSrvSetSocket

TipcSrv::SubjectCbCreate

Syntax:
virtual T_CB SubjectCbCreate(T_STR subject, T_IPC_MT mt, 
                             T_IPC_SRV_SUBJECT_FUNC func, 
                             T_CB_ARG arg); 
Remarks:
Create a subject callback.
C API:
TipcSrvSubjectCbCreate

TipcSrv::SubjectCbLookup

Syntax:
virtual T_CB SubjectCbLookup(T_STR subject, T_IPC_MT mt, 
                             T_IPC_SRV_SUBJECT_FUNC func, 
                             T_CB_ARG arg); 
Remarks:
Look up a subject callback.
C API:
TipcSrvSubjectCbLookup

TipcSrv::SubjectDefaultCbCreate

Syntax:
T_CB SubjectDefaultCbCreate(T_IPC_SRV_SUBJECT_FUNC func, 
                            T_CB_ARG arg); 
Remarks:
Create the default subject callback.
C API:
TipcSrvSubjectDefaultCbCreate

TipcSrv::SubjectDefaultCbLookup

Syntax:
T_CB SubjectDefaultCbLookup(T_IPC_SRV_SUBJECT_FUNC func, 
                            T_CB_ARG arg); 
Remarks:
Look up the default subject callback.
C API:
TipcSrvSubjectDefaultCbLookup

TipcSrv::SubjectCbDestroyAll

Syntax:
virtual T_BOOL SubjectCbDestroyAll(); 
Remarks:
Destroy all subject callbacks.
C API:
TipcSrvSubjectCbDestroyAll

TipcSrv::SubjectGmdInit

Syntax:
virtual T_BOOL SubjectGmdInit(T_STR subject); 
Remarks:
Initialize GMD for a subject.
C API:
TipcSrvSubjectGmdInit

TipcSrv::SubjectLbInit

Syntax:
virtual T_BOOL SubjectLbInit(T_STR subject); 
Remarks:
Initialize load balancing for a subject.
C API:
TipcSrvSubjectLbInit

TipcSrv::SubjectSubscribe

Syntax:
T_BOOL SubjectSubscribe(T_STR subject); 
Remarks:
Get whether or not an RTclient is subscribed to a subject.
C API:
TipcSrvSubjectGetSubscribe
 
  
Syntax:
T_BOOL SubjectSubscribe(T_STR subject, T_BOOL subscribe_status); 
Remarks:
Start or stop subscribing to a subject.
C API:
TipcSrvSubjectSetSubscribe

TipcSrv::SubjectSubscribeLb

Syntax:
T_BOOL SubjectSubscribeLb(T_STR subject,  
                          T_BOOL *lb_status_return); 
Remarks:
Get whether or not an RTclient is subscribed to a subject, including load balancing information.
C API:
TipcSrvSubjectGetSubscribeLb
 
  
Syntax:
T_BOOL SubjectSubscribeLb(T_STR subject, T_BOOL subscribe_status, 
                          T_BOOL lb_status); 
Remarks:
Start or stop subscribing to a subject, with or without load balancing.
C API:
TipcSrvSubjectSetSubscribeLb

TipcSrv::SrvWrite

Syntax:
T_BOOL SrvWrite(T_STR dest, TipcMt& mt, 
                T_BOOL check_server_msg_send, ...); 
Remarks:
Construct a message and send it through the connection to RTserver.
C API:
TipcSrvMsgWrite

TipcSrv::SrvWriteVa

Syntax:
T_BOOL SrvWriteVa(T_STR dest, TipcMt& mt, 
                  T_BOOL check_server_msg_send, 
                  va_list var_arg_list); 
Remarks:
Construct a message and send it through the connection to RTserver (va_list version).
C API:
TipcSrvMsgWriteVa

TipcSrv::Timeout

Syntax:
virtual T_REAL8 Timeout(T_IPC_TIMEOUT timeout); 
Remarks:
Get a timeout property of the connection to RTserver.
C API:
TipcSrvGetTimeout
 
  
Syntax:
virtual T_BOOL Timeout(T_IPC_TIMEOUT timeout, T_REAL8 value); 
Remarks:
Set a timeout property of the connection to RTserver.
C API:
TipcSrvSetTimeout

TipcSrv::UniqueSubject

Syntax:
virtual T_STR UniqueSubject(); 
Remarks:
Get the unique subject of the connected RTserver.
C API:
TipcSrvGetUniqueSubject

TipcSrv::Unlock

Syntax:
virtual T_BOOL Unlock(); 
Remarks:
Release exclusive access to the connection to RTserver.
C API:
TipcSrvUnlock

TipcSrv::User

Syntax:
virtual T_STR User(); 
Remarks:
Get the user name of the connected RTserver.
C API:
TipcSrvGetUser

TipcSrv::WriteCbCreate

Syntax:
virtual T_CB 
WriteCbCreate(TipcMt& mt, T_IPC_CONN_WRITE_CB_FUNC func, 
              T_CB_ARG arg); 
Remarks:
Create a write callback in the connection to RTserver.
C API:
TipcSrvWriteCbCreate

TipcSrv::WriteCbLookup

Syntax:
virtual T_CB WriteCbLookup(TipcMt& mt,  
                           T_IPC_CONN_WRITE_CB_FUNC func, 
                           T_CB_ARG arg); 
Remarks:
Look up a write callback in the connection to RTserver.
C API:
TipcSrvWriteCbLookup

TipcSrv::XtSource

Syntax:
virtual T_INT4 XtSource(); 
Remarks:
Get source suitable for XtAppAddInput from the connection to RTserver.
C API:
TipcSrvGetXtSource

Static Public Member Functions

TipcSrv::CreateCbCreate

Syntax:
static T_CB CreateCbCreate(T_IPC_SRV_CREATE_CB_FUNC func, 
                           T_CB_ARG arg); 
Remarks:
Create a server create callback.
C API:
TipcSrvCreateCbCreate

TipcSrv::CreateCbLookup

Syntax:
static T_CB CreateCbLookup(T_IPC_SRV_CREATE_CB_FUNC func, 
                           T_CB_ARG arg); 
Remarks:
Look up a server create callback.
C API:
TipcSrvCreateCbLookup

TipcSrv::Destroy

Syntax:
static T_BOOL Destroy(T_IPC_SRV_CONN_STATUS destroy_status); 
Remarks:
Destroy the connection to RTserver.
C API:
TipcSrvDestroy

TipcSrv::DestroyCbCreate

Syntax:
static T_CB DestroyCbCreate(T_IPC_SRV_DESTROY_CB_FUNC func, 
                            T_CB_ARG arg); 
Remarks:
Create a server destroy callback.
C API:
TipcSrvDestroyCbCreate

TipcSrv::DestroyCbLookup

Syntax:
static T_CB DestroyCbLookup(T_IPC_SRV_DESTROY_CB_FUNC func, 
                            T_CB_ARG arg); 
Remarks:
Look up a server destroy callback.
C API:
TipcSrvDestroyCbLookup

TipcSrv::GmdDir

Syntax:
static T_STR GmdDir(); 
Remarks:
Get name of directory where files are written for guaranteed message delivery.
C API:
TipcGetGmdDir

TipcSrv::Instance

Syntax:
static TipcSrv& Instance(); 
Remarks:
Return a handle to a TipcSrv object. Do not create a connection to RTserver at this time.

TipcSrv::InstanceCreate

Syntax:
static TipcSrv& InstanceCreate(T_IPC_SRV_CONN_STATUS 
create_status); 
Remarks:
Return a handle to a TipcSrv object and create a connection to RTserver.

TipcSrv::IsRunning

Syntax:
static T_BOOL IsRunning(); 
Remarks:
Check if RTserver is up and running.
C API:
TipcSrvIsRunning

TipcSrv::LogAddMt

Syntax:
static T_BOOL LogAddMt(T_IPC_SRV_LOG_TYPE log_type,  
                       TipcMt& mt); 
Remarks:
Add a message type to a message file logging type.
C API:
TipcSrvLogAddMt

TipcSrv::LogRemoveMt

Syntax:
static T_BOOL LogRemoveMt(T_IPC_SRV_LOG_TYPE log_type, 
                          TipcMt& mt); 
Remarks:
Remove a message type from a message file logging type.
C API:
TipcSrvLogRemoveMt

TipcSrv::StdSubjectRetrieve

Syntax:
static T_BOOL StdSubjectRetrieve(T_BOOL retrieve_time); 
Remarks:
Retrieve current values for all standard subjects.
C API:
TipcSrvStdSubjectRetrieve

TipcSrv::StdSubjectSetSubscribe

Syntax:
static T_BOOL StdSubjectSetSubscribe(T_BOOL subscribe_flag, 
                                     T_BOOL time_flag); 
Remarks:
Start or stop subscribing to all standard subjects.
C API:
TipcSrvStdSubjectSetSubscribe

TipcSrv::SubjectTraverseSubscribe

Syntax:
static T_PTR 
SubjectTraverseSubscribe(T_IPC_SRV_SUBJECT_TRAV_FUNC func, 
                         T_PTR arg); 
Remarks:
Traverse the subjects to which an RTclient is subscribing.
C API:
TipcSrvSubjectTraverseSubscribe

TipcSrv::Stop

Syntax:
static T_BOOL Stop(T_IPC_SRV_STOP_TYPE stop_type); 
Remarks:
Stop RTserver and possibly more processes.
C API:
TipcSrvStop

Example

This code fragment obtains a handle to RTserver by calling the static member function Instance(), creates callbacks, then uses a call to the Create member function to create the actual underlying connection to the server. It then destroys the underlying connection to RTserver.

TipcSrv& rtserver = TipcSrv::Instance(); 
rtserver.CreateCbCreate(MyCallbacks::cb_server_create, NULL); 
 
if (!rtserver) { 
  // error 
} 
 
// server destroy callback  
rtserver.DestroyCbCreate(MyCallbacks::cb_server_destroy, NULL); 
 
if (!rtserver) { 
  // error 
} 
 
cout << "Creating connection to RTserver." << endl; 
 
if (!rtserver.Create(T_IPC_SRV_CONN_FULL)) { 
  // error 
} 
 
// Now Destroy connection to RTserver to show how this can be done.  
cout << "Destroying connection to RTserver but leave it warm."
  << endl; 
 
if (!TipcSrv::Destroy(T_IPC_SRV_CONN_WARM)) { 
  // error 
} 

TIBCO SmartSockets™ cxxipc Class Library
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com