Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TGo4Socket Class Reference

#include <TGo4Socket.h>

List of all members.

Public Methods

 TGo4Socket (Bool_t IsClient)
virtual ~TGo4Socket ()
virtual Int_t Open (const char *host, Int_t port, Bool_t keepservsock=kFALSE)
virtual Int_t Close ()
virtual Int_t Send (TObject *obj)
virtual Int_t Send (const char *name)
virtual TObject * Recv (const char *name=0)
virtual Text_t * RecvRaw (const char *name=0)
Bool_t IsOpen () const
Bool_t IsClientMode () const
Int_t GetPort () const
Int_t SendBuffer (TBuffer *buf)
 Send raw buffer of external TBuffer object. More...

Int_t ReceiveBuffer ()
 Receive raw buffer and fill the internal TBuffer of this socket instance with it. More...

const TBuffer * GetBuffer () const
 Access the internal receiving buffer of this socket. More...


Static Public Attributes

const Int_t fguOPENWAIT = 200
 Time to sleep between client open retries. More...

const Int_t fgiOPENCYCLES = 6
 Number of retries for client open. More...

const Int_t fgiBUFLENGTH = 256
 Raw transport buffer size. More...

const Int_t fgiBUFINITSIZE = 65536
 Initial size for object receive buffer (TBuffer). More...

const Int_t fgiBUFEXTRASPACE = 8
 ROOT internal constant: extra space for reallocating object receive buffer (TBuffer). More...

const Text_t fgcGOON [] = "-I- go on"
 First connection string, we are told to go on... More...

const Int_t fgiISOWNER = BIT(14)
 We emulate the protected owner flag of the TBuffer class, needed for reallocation! More...


Protected Methods

 TGo4Socket ()
void ReallocBuffer (TBuffer *buffer, Int_t oldsize, Int_t newsize)
 Reallocate the fixed input buffer if necessary. More...


Private Attributes

Bool_t fbClientMode
 True if instance runs in as client. More...

Bool_t fbOpen
 True if connection is open. More...

TGo4SocketSignalHandlerfxSignalHandler
  More...

TSocket * fxSocket
 root TSocket class doing the work. More...

TServerSocket * fxServerSocket
 Server Socket (server mode only). More...

Int_t fiPort
 Connected port number (of server socket which opened with portnumberscan). More...

Text_t * fxLocalBuffer
TBuffer * fxBuffer
  More...


Constructor & Destructor Documentation

TGo4Socket::TGo4Socket Bool_t    IsClient
 

Definition at line 47 of file TGo4Socket.cxx.

References TGo4Log::Debug(), fgiBUFINITSIZE, fgiBUFLENGTH, fxBuffer, fxLocalBuffer, fxSignalHandler, and TRACE.

TGo4Socket::~TGo4Socket   [virtual]
 

Definition at line 66 of file TGo4Socket.cxx.

References fxLocalBuffer, fxServerSocket, fxSignalHandler, fxSocket, and TRACE.

TGo4Socket::TGo4Socket   [protected]
 


Member Function Documentation

Int_t TGo4Socket::Open const char *    host,
Int_t    port,
Bool_t    keepservsock = kFALSE
[virtual]
 

Definition at line 82 of file TGo4Socket.cxx.

References TGo4Log::Debug(), fbOpen, fgcGOON, fgiOPENCYCLES, fguOPENWAIT, fiPort, fxServerSocket, fxSocket, and TRACE.

Referenced by TGo4TaskHandler::ConnectClientChannel(), TGo4ObjClient::ConnectServer(), TGo4TaskHandler::ServerRequest(), TGo4ServerTask::StopConnectorThread(), TGo4ServerTask::TimerConnect(), and TGo4HistogramServer::TimerConnect().

Int_t TGo4Socket::Close   [virtual]
 

Definition at line 205 of file TGo4Socket.cxx.

References fbOpen, fxSocket, and TRACE.

Referenced by TGo4TaskHandler::CloseChannels(), TGo4TaskHandler::DisConnect(), TGo4ObjClient::DisconnectServer(), TGo4TaskHandler::ServerRequest(), TGo4ServerTask::StopConnectorThread(), TGo4ServerTask::TimerConnect(), TGo4HistogramServer::TimerConnect(), TGo4HistogramServer::~TGo4HistogramServer(), and TGo4TaskManager::~TGo4TaskManager().

Int_t TGo4Socket::Send TObject *    obj [virtual]
 

Definition at line 361 of file TGo4Socket.cxx.

References TGo4Log::Debug(), TGo4LockGuard::fgxMainMutex, fxSocket, IsOpen(), and TRACE.

Referenced by TGo4TaskManager::AddClient(), TGo4HistogramServer::CheckLogin(), TGo4TaskHandler::ConnectClientChannel(), TGo4ObjClient::ConnectServer(), TGo4TaskHandler::ConnectServerChannel(), TGo4TaskHandler::DisConnect(), TGo4ObjClient::ReceiveObject(), TGo4CommandRunnable::Run(), TGo4ObjClient::SendCommand(), TGo4HistogramServer::SendObject(), TGo4TaskManager::ServeClient(), TGo4TaskHandler::ServerLogin(), TGo4TaskHandler::ServerRequest(), and TGo4ServerTask::StopConnectorThread().

Int_t TGo4Socket::Send const char *    name [virtual]
 

Definition at line 397 of file TGo4Socket.cxx.

References TGo4Log::Debug(), fgiBUFLENGTH, fxLocalBuffer, fxSocket, IsOpen(), and TRACE.

TObject * TGo4Socket::Recv const char *    name = 0 [virtual]
 

Definition at line 465 of file TGo4Socket.cxx.

References TGo4Log::Debug(), fxSocket, IsOpen(), and TRACE.

Text_t * TGo4Socket::RecvRaw const char *    name = 0 [virtual]
 

Definition at line 427 of file TGo4Socket.cxx.

References TGo4Log::Debug(), fgiBUFLENGTH, fxLocalBuffer, fxSocket, IsOpen(), and TRACE.

Referenced by TGo4HistogramServer::CheckLogin(), TGo4TaskManager::ClientLogin(), TGo4TaskHandler::ConnectClientChannel(), TGo4ObjClient::ConnectServer(), TGo4TaskHandler::ConnectServerChannel(), TGo4TaskManager::DisConnectClient(), TGo4HistogramServer::HandleObjectRequest(), TGo4ObjClient::ReceiveObject(), TGo4CommandRunnable::Run(), TGo4HistogramServer::SendObject(), TGo4TaskManager::ServeClient(), and TGo4TaskHandler::ServerLogin().

Bool_t TGo4Socket::IsOpen   const [inline]
 

Definition at line 39 of file TGo4Socket.h.

References fbOpen.

Referenced by TGo4TaskHandlerRunnable::CheckTransportOpen(), TGo4TaskHandler::ConnectClientChannel(), TGo4TaskHandler::ConnectServerChannel(), ReceiveBuffer(), Recv(), RecvRaw(), Send(), SendBuffer(), TGo4ServerTask::TimerConnect(), and TGo4HistogramServer::TimerConnect().

Bool_t TGo4Socket::IsClientMode   const [inline]
 

Definition at line 41 of file TGo4Socket.h.

References fbClientMode.

Int_t TGo4Socket::GetPort   const [inline]
 

Definition at line 43 of file TGo4Socket.h.

References fiPort.

Referenced by TGo4TaskManager::GetNegotiationPort(), TGo4HistogramServer::GetObjPort(), and TGo4TaskHandler::WaitGetPort().

Int_t TGo4Socket::SendBuffer TBuffer *    buf
 

Send raw buffer of external TBuffer object.

Method will prepare raw buffer as a TMessage, i.e. the receiving side should be able to receive it by root TSocket message protocol.

Definition at line 222 of file TGo4Socket.cxx.

References TGo4Log::Debug(), IsOpen(), and TRACE.

Referenced by TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), TGo4CommandRunnable::Run(), and TGo4HistogramServer::SendObject().

Int_t TGo4Socket::ReceiveBuffer  
 

Receive raw buffer and fill the internal TBuffer of this socket instance with it.

Definition at line 287 of file TGo4Socket.cxx.

References TGo4Log::Debug(), fgiBUFINITSIZE, fxBuffer, fxSocket, IsOpen(), ReallocBuffer(), and TRACE.

Referenced by TGo4ObjClient::ReceiveBuffer(), TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), and TGo4CommandRunnable::Run().

const TBuffer* TGo4Socket::GetBuffer   const [inline]
 

Access the internal receiving buffer of this socket.

Definition at line 61 of file TGo4Socket.h.

References fxBuffer.

Referenced by TGo4ObjClient::ReceiveBuffer(), TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), and TGo4CommandRunnable::Run().

void TGo4Socket::ReallocBuffer TBuffer *    buffer,
Int_t    oldsize,
Int_t    newsize
[protected]
 

Reallocate the fixed input buffer if necessary.

Definition at line 507 of file TGo4Socket.cxx.

References fgiBUFEXTRASPACE, and fgiISOWNER.

Referenced by ReceiveBuffer().


Member Data Documentation

const Int_t TGo4Socket::fguOPENWAIT = 200 [static]
 

Time to sleep between client open retries.

Definition at line 30 of file TGo4Socket.cxx.

Referenced by Open().

const Int_t TGo4Socket::fgiOPENCYCLES = 6 [static]
 

Number of retries for client open.

Definition at line 31 of file TGo4Socket.cxx.

Referenced by Open().

const Int_t TGo4Socket::fgiBUFLENGTH = 256 [static]
 

Raw transport buffer size.

Definition at line 32 of file TGo4Socket.cxx.

Referenced by RecvRaw(), Send(), and TGo4Socket().

const Int_t TGo4Socket::fgiBUFINITSIZE = 65536 [static]
 

Initial size for object receive buffer (TBuffer).

Definition at line 33 of file TGo4Socket.cxx.

Referenced by TGo4BufferQueue::FreeBuffer(), TGo4BufferQueue::NewEntry(), ReceiveBuffer(), and TGo4Socket().

const Int_t TGo4Socket::fgiBUFEXTRASPACE = 8 [static]
 

ROOT internal constant: extra space for reallocating object receive buffer (TBuffer).

Definition at line 34 of file TGo4Socket.cxx.

Referenced by TGo4BufferQueue::Realloc(), and ReallocBuffer().

const Text_t TGo4Socket::fgcGOON = "-I- go on" [static]
 

First connection string, we are told to go on...

Definition at line 35 of file TGo4Socket.cxx.

Referenced by Open().

const Int_t TGo4Socket::fgiISOWNER = BIT(14) [static]
 

We emulate the protected owner flag of the TBuffer class, needed for reallocation!

Definition at line 41 of file TGo4Socket.cxx.

Referenced by ReallocBuffer().

Bool_t TGo4Socket::fbClientMode [private]
 

True if instance runs in as client.

Definition at line 93 of file TGo4Socket.h.

Referenced by IsClientMode().

Bool_t TGo4Socket::fbOpen [private]
 

True if connection is open.

Definition at line 96 of file TGo4Socket.h.

Referenced by Close(), IsOpen(), and Open().

TGo4SocketSignalHandler* TGo4Socket::fxSignalHandler [private]
 

Definition at line 100 of file TGo4Socket.h.

Referenced by TGo4Socket(), and ~TGo4Socket().

TSocket* TGo4Socket::fxSocket [private]
 

root TSocket class doing the work.

Definition at line 103 of file TGo4Socket.h.

Referenced by Close(), Open(), ReceiveBuffer(), Recv(), RecvRaw(), Send(), and ~TGo4Socket().

TServerSocket* TGo4Socket::fxServerSocket [private]
 

Server Socket (server mode only).

Definition at line 106 of file TGo4Socket.h.

Referenced by Open(), and ~TGo4Socket().

Int_t TGo4Socket::fiPort [private]
 

Connected port number (of server socket which opened with portnumberscan).

Definition at line 109 of file TGo4Socket.h.

Referenced by GetPort(), and Open().

Text_t* TGo4Socket::fxLocalBuffer [private]
 

Definition at line 111 of file TGo4Socket.h.

Referenced by RecvRaw(), Send(), TGo4Socket(), and ~TGo4Socket().

TBuffer* TGo4Socket::fxBuffer [private]
 

Definition at line 115 of file TGo4Socket.h.

Referenced by GetBuffer(), ReceiveBuffer(), and TGo4Socket().


The documentation for this class was generated from the following files:
Generated on Tue Nov 8 10:56:55 2005 for Go4-v2.10-5 by doxygen1.2.15