1 #ifndef __JNET__JCONTROLHOST__ 
    2 #define __JNET__JCONTROLHOST__ 
   24 namespace JPP { 
using namespace JNET; }
 
  178       if (p != this->end() && p->getID() == subscription.
getID()) {
 
  187       this->insert(subscription);
 
  219         buffer += 
' ' + i->toString();
 
  249     public JThrow<JControlHost>
 
  271       return tag[0] == 
'_';
 
  387     int MyId(
const std::string& nick_name)
 
  427         JPrefix __prefix__(tag, length);
 
  432           write((
char*) buffer, (
int) length);
 
  438         return Throw(error, -1);
 
  451     int PutFullData(
const std::string& tag, 
const void* buffer, 
const long long int length)
 
  457         return Throw(error, -1);
 
  460         return Throw(error, -2);
 
  473                       const std::string& buffer)
 
  487                       const std::string& buffer)
 
  489       return PutFullData(tag, buffer.c_str(), buffer.size());
 
  521         return Throw(error, -1);
 
  533     int WaitHead(std::string& tag, 
long long int& length)
 
  569         return Throw(error, -1);
 
  582     int CheckHead(std::string& tag, 
long long int& length, 
const int timeout_us = 0)
 
  584       const int rvalue = 
CheckHead(this->prefix, timeout_us);
 
  587         tag    = this->prefix.
getTag();
 
  588         length = this->prefix.
getSize();
 
  606         read((
char*) buffer, (
int) length);
 
  611         return Throw(error, -1);
 
  624       buffer.resize(this->prefix.
getSize());
 
  626       return GetFullData((
char*) buffer.data(), buffer.size());
 
  638     static int WhereIs(
const std::string& host_name,
 
  639                        const std::string& nick_name, 
 
  651         long long int length;
 
  659         return Throw(error, -1);
 
  683         return Throw(error, -1);
 
void setReuseAddress(const bool on)
Set reuse address. 
 
static const JTag DISPTAG_Subscribe("_Subscri")
Special ControlHost tags. 
 
JSubscription_t getSubscription() const 
Get subscription type. 
 
int Subscribe(const JSubscriptionList &subscription)
Subscribe to list of tags. 
 
static const int DISPATCH_PORT
Default ControlHost port. 
 
JSubscriptionAll(const JTag &tag)
Constructor. 
 
Auxiliary base class for aritmetic operations of derived class types. 
 
int MyId(const std::string &nick_name)
Identify. 
 
int CheckHead(std::string &tag, long long int &length, const int timeout_us=0)
Check for header, without waiting. 
 
JSubscription_t
ControlHost subscription types. 
 
int write(const char *buffer, const int length)
Write data to socket. 
 
static const std::string CHOO_VERSION
 
const char * c_str() const 
C-string. 
 
void setSendBufferSize(const int size)
Set send buffer size. 
 
int Connected()
Send version. 
 
JSubscriptionList(const JSubscription &subscription)
Copy constructor. 
 
int WaitHead(std::string &tag, long long int &length)
Wait for header. 
 
Auxiliary base class for controling the throwing of exceptions. 
 
static JTimeval min()
Get minimal time value. 
 
const std::set< JSubscription > * operator->() const 
Smart pointer. 
 
int PutFullString(const std::string &tag, const std::string &buffer)
Send string. 
 
static const JTag DISPTAG_MyId("_MyId")
 
std::string toString() const 
Convert subscription list to string. 
 
int Subscribe(const JSubscription &subscription)
Subscribe to single tag. 
 
int SendMeAlways()
Tell server to send messages forever. 
 
std::set< JSubscription >::const_reverse_iterator const_reverse_iterator
 
static const JTag DISPTAG_WhereIs("_WhereIs")
 
Auxiliary data structure for hostname and port number. 
 
std::string toString() const 
Convert subscription to string. 
 
int getSize() const 
Get size. 
 
JControlHost(const JSocket &socket)
Constructor. 
 
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
 
static const JTag DISPTAG_Version("_Version")
 
Auxiliary class for time values. 
 
int CheckHead(JPrefix &prefix, JTimeval timeout=JTimeval::min())
Check for header, without waiting. 
 
bool in_avail(JTimeval timeout=JTimeval::min()) const 
Check availability of input. 
 
JSubscription(const JSubscription_t sub, const JTag &tag)
Constructor. 
 
JSubscriptionList()
Default constructor. 
 
JControlHost(const std::string &server, const int port)
Constructor. 
 
int PutFullData(const std::string &tag, const void *buffer, const long long int length)
Send data. 
 
JControlHost(const int ip_number, const int port=DISPATCH_PORT)
Constructor. 
 
JControlHost(const JHostname &server)
Constructor. 
 
int GetFullString(std::string &buffer)
Receive string. 
 
std::set< JSubscription >::const_iterator const_iterator
 
int shutdown()
Shut down socket. 
 
JControlHost ControlHost
Match name. 
 
int SendMeNext()
Tell server to send next message. 
 
JTag_t getID() const 
Get identifier. 
 
Auxiliary class for any subscription. 
 
JSubscriptionList & add(const JSubscriptionList &subscription)
Add subscription. 
 
JControlHost & operator=(const JControlHost &)
 
JSubscriptionList & add(const JSubscription &subscription)
Add subscription. 
 
Exception for ControlHost. 
 
Auxiliary class for all subscription. 
 
JSubscriptionAny(const JTag &tag)
Constructor. 
 
static bool is_valid(const char c)
Check validity of subscription specifier. 
 
const JTag & getTag() const 
Get tag. 
 
static bool maybe_special(const JTag &tag)
Check special ControlHost tags. 
 
void setReceiveBufferSize(const int size)
Set receive buffer size. 
 
Vec operator+(const Vec &a, const Vec &b)
Add two vectors. 
 
int WaitHead(JPrefix &prefix)
Wait for header. 
 
std::string toString() const 
Convert tag to string. 
 
int configure()
Configure socket (factory reset). 
 
int GetFullData(void *buffer, long long int length)
Receive data. 
 
static const JTag DISPTAG_Gime("_Gime")
 
ControlHost subscription. 
 
void connect(const int port)
Connect to port on local host. 
 
void setNonBlocking(const bool on)
Set non-blocking of I/O. 
 
JSubscriptionList getSubscription(const JEventTable &event_table)
Convert event table to ControlHost subscription. 
 
Base class for data structures with artithmetic capabilities. 
 
void setKeepAlive(const bool on)
Set keep alive of socket. 
 
static int WhereIs(const std::string &host_name, const std::string &nick_name, std::string &answer)
Locate ControlHost client(s). 
 
void setTcpNoDelay(const bool on)
Set TCP no-delay. 
 
int read(char *buffer, const int length)
Read data from socket. 
 
static const JTag DISPTAG_Always("_Always")
 
~JControlHost()
Destructor. 
 
JSubscription_t subscription
 
int PutFullData(const JTag &tag, const void *buffer, const long long int length)
Send data. 
 
static void Throw(const bool option)
Enable/disable throw option. 
 
int PutFullString(const JTag &tag, const std::string &buffer)
Send string. 
 
JControlHost()
Default constructor.