7. Subsystem "Communication interfaces' protocols" (TProtocolS)
Subsystem "Communication interfaces' protocols" is presented by the TProtocolS object, which contains modular objects of the separate protocols TProtocol on the a subsystem's level. Each protocol contains objects of the opened sessions of the incoming protocols TProtocolIn.
TProtocolS object provides an access to the both: the incoming and the outgoing protocols of the individual types of transport protocols. The inner side of outgoing protocol based on the steaming principle with the individual structure of the stream for each implementation of the protocol.
7.1. The object of the Communication interfaces' protocols subsystem (TProtocolS)
Public methods:
- int subVer( ); Subsystem's version.
- AutoHD<TProtocol> at( const string &id ); Connection to the protocol's id module.
- string optDescr( ); Localized help for command-line options and parameters of the configuration file.
7.2. The modular object of the protocol (TProtocol)
Inherits: | TModule. |
Inherited: | By the root object of the subsystem's "Protocols" modules. |
Public methods:
- virtual void itemListIn( vector<string> &ls, const string &curIt = "" ); Items list of protocol for individual addressing into transport.
- void list( vector<string> &list ); The list of open incoming sessions.
- bool openStat( const string &name ); Check for the openness of the incoming session with the specified name.
- void open( const string &name, TTransportIn *tr = NULL, const string &sender = "" ); Opening of the session on behalf of the incoming transport tr.
- void close( const string &name ); Closing of the incoming session.
- AutoHD<TProtocolIn> at( const string &name ); Connecting to the open incoming sessions.
- virtual void outMess( XMLNode &io, TTransportOut &tro ); Sending the data in the XML tree in over the protocol and transport tro.
7.3. The object of the incoming protocol's session (TProtocolIn)
Inherits: | TCntrNode. |
Inherited: | By the session objects of the incoming modules' protocol of the subsystem "Protocols". |
Public methods:
- TProtocolIn( const string &name ); Initializing constructor.
- string name( ); The name of the incoming session.
- AutoHD<TTransportIn> &srcTr( ) The transport-source of the opening of the session of the incoming protocol.
- const string &srcAddr( ) The sender address; second line contains service part of the address for backward messages.
- virtual unsigned waitReqTm( ); A request waiting time on input transport (in milliseconds), after what call to the protocol with the empty message the polling mode. Setting it to zero will disable the polling mode.
- virtual void setSrcTr( TTransportIn *vl ) Setting of the transport-source of the opening of the session of the incoming protocol.
- virtual void setSrcAddr( const string &vl ); Setting of the sender address.
- int writeTo( const string &data ); Sending the messages data backward to the sender, into srcAddr().
- virtual bool mess( const string &request, string &answer ); Transfer of unstructured data to their processing by the protocol.
- TProtocol &owner( ); The protocol, the owner of incoming sessions.