GSI Object Oriented Online Offline (Go4)
GO4-5.3.2
|
#include <TGo4Socket.h>
Public Member Functions | |
TGo4Socket (Bool_t IsClient) | |
virtual | ~TGo4Socket () |
virtual Int_t | Open (const char *host, Int_t port, Bool_t keepservsock=kFALSE) |
virtual Int_t | Close (Option_t *opt="") |
virtual Int_t | Send (TObject *obj) |
virtual Int_t | Send (const char *name) |
virtual TObject * | Recv (const char *name=0) |
virtual char * | RecvRaw (const char *name=0) |
Bool_t | IsOpen () const |
Bool_t | IsClientMode () const |
Int_t | GetPort () const |
Int_t | SendBuffer (TBuffer *buf) |
Int_t | ReceiveBuffer () |
const TBuffer * | GetBuffer () const |
Static Public Attributes | |
static const Int_t | fguOPENWAIT =200 |
static const Int_t | fgiOPENCYCLES =6 |
static const Int_t | fgiBUFLENGTH =256 |
static const Int_t | fgiBUFINITSIZE =65536 |
static const Int_t | fgiBUFEXTRASPACE =8 |
static const char * | fgcGOON = "-I- go on" |
static const Int_t | fgiISOWNER = BIT(14) |
Protected Member Functions | |
TGo4Socket () | |
void | ReallocBuffer (TBuffer *buffer, Int_t oldsize, Int_t newsize) |
Private Attributes | |
Bool_t | fbClientMode |
Bool_t | fbOpen |
TSocket * | fxSocket |
TServerSocket * | fxServerSocket |
Int_t | fiPort |
char * | fxLocalBuffer |
TBuffer * | fxBuffer |
Definition at line 23 of file TGo4Socket.h.
TGo4Socket::TGo4Socket | ( | Bool_t | IsClient | ) |
Definition at line 52 of file TGo4Socket.cxx.
References TGo4Log::Debug(), TGo4SocketSignalHandler::DisableSigPipe(), fbClientMode, fgiBUFINITSIZE, fgiBUFLENGTH, fxBuffer, fxLocalBuffer, GO4TRACE, TGo4SocketSignalHandler::SetSigWINCH(), and TGo4Buffer.
|
virtual |
Definition at line 78 of file TGo4Socket.cxx.
References fxBuffer, fxLocalBuffer, fxServerSocket, fxSocket, and GO4TRACE.
|
protected |
|
virtual |
Definition at line 226 of file TGo4Socket.cxx.
References fbOpen, fxSocket, and GO4TRACE.
Referenced by TGo4TaskHandler::CloseChannels(), TGo4TaskHandler::Connect(), TGo4TaskHandler::DisConnect(), TGo4ObjClient::DisconnectServer(), TGo4TaskHandler::ServerRequest(), TGo4ServerTask::StopConnectorThread(), TGo4HistogramServer::TimerConnect(), TGo4ServerTask::TimerConnect(), TGo4HistogramServer::~TGo4HistogramServer(), and TGo4TaskManager::~TGo4TaskManager().
|
inline |
Access the internal receiving buffer of this socket.
Definition at line 58 of file TGo4Socket.h.
References fxBuffer.
Referenced by TGo4ObjClient::ReceiveBuffer(), TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), and TGo4CommandRunnable::Run().
|
inline |
Definition at line 40 of file TGo4Socket.h.
References fiPort.
Referenced by TGo4TaskManager::GetNegotiationPort(), TGo4HistogramServer::GetObjPort(), and TGo4TaskHandler::WaitGetPort().
|
inline |
Definition at line 38 of file TGo4Socket.h.
References fbClientMode.
|
inline |
Definition at line 36 of file TGo4Socket.h.
References fbOpen.
Referenced by TGo4TaskHandlerRunnable::CheckTransportOpen(), TGo4TaskHandler::ConnectClientChannel(), TGo4TaskHandler::ConnectServerChannel(), ReceiveBuffer(), Recv(), RecvRaw(), Send(), SendBuffer(), TGo4HistogramServer::TimerConnect(), and TGo4ServerTask::TimerConnect().
|
virtual |
Definition at line 106 of file TGo4Socket.cxx.
References TGo4Log::Debug(), fbClientMode, fbOpen, fgcGOON, fgiOPENCYCLES, fguOPENWAIT, fiPort, fxServerSocket, fxSocket, and GO4TRACE.
Referenced by TGo4TaskHandler::ConnectClientChannel(), TGo4ObjClient::ConnectServer(), TGo4TaskHandler::ServerRequest(), TGo4ServerTask::StopConnectorThread(), TGo4TaskManager::TGo4TaskManager(), TGo4HistogramServer::TimerConnect(), and TGo4ServerTask::TimerConnect().
|
protected |
Reallocate the fixed input buffer if necessary
Definition at line 494 of file TGo4Socket.cxx.
References fgiBUFEXTRASPACE, and fgiISOWNER.
Referenced by ReceiveBuffer().
Int_t TGo4Socket::ReceiveBuffer | ( | ) |
Receive raw buffer and fill the internal TBuffer of this socket instance with it.
Definition at line 289 of file TGo4Socket.cxx.
References TGo4Log::Debug(), fgiBUFINITSIZE, fxBuffer, fxSocket, GO4TRACE, IsOpen(), and ReallocBuffer().
Referenced by TGo4ObjClient::ReceiveBuffer(), TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), and TGo4CommandRunnable::Run().
|
virtual |
Definition at line 452 of file TGo4Socket.cxx.
References TGo4Log::Debug(), fxSocket, GO4TRACE, and IsOpen().
|
virtual |
Definition at line 421 of file TGo4Socket.cxx.
References TGo4Log::Debug(), fgiBUFLENGTH, fxLocalBuffer, fxSocket, GO4TRACE, and IsOpen().
Referenced by TGo4HistogramServer::CheckLogin(), TGo4TaskManager::ClientLogin(), TGo4TaskHandler::Connect(), TGo4TaskHandler::ConnectClientChannel(), TGo4ObjClient::ConnectServer(), TGo4TaskHandler::ConnectServerChannel(), TGo4TaskManager::DisConnectClient(), TGo4HistogramServer::HandleObjectRequest(), TGo4ObjClient::ReceiveObject(), TGo4CommandRunnable::Run(), TGo4HistogramServer::SendObject(), TGo4TaskManager::ServeClient(), and TGo4TaskHandler::ServerLogin().
|
virtual |
Definition at line 352 of file TGo4Socket.cxx.
References TGo4Log::Debug(), fxSocket, GO4TRACE, and IsOpen().
Referenced by TGo4TaskManager::AddClient(), TGo4HistogramServer::CheckLogin(), TGo4TaskHandler::Connect(), 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().
|
virtual |
Definition at line 386 of file TGo4Socket.cxx.
References TGo4Log::Debug(), fgiBUFLENGTH, fxLocalBuffer, fxSocket, GO4TRACE, and IsOpen().
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 236 of file TGo4Socket.cxx.
References TGo4Log::Debug(), fxSocket, GO4TRACE, and IsOpen().
Referenced by TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), TGo4CommandRunnable::Run(), and TGo4HistogramServer::SendObject().
|
private |
True if instance runs in as client
Definition at line 90 of file TGo4Socket.h.
Referenced by IsClientMode(), Open(), and TGo4Socket().
|
private |
True if connection is open
Definition at line 93 of file TGo4Socket.h.
|
static |
First connection string, we are told to go on...
Definition at line 76 of file TGo4Socket.h.
Referenced by Open().
|
static |
ROOT internal constant: extra space for reallocating object receive buffer (TBuffer)
Definition at line 73 of file TGo4Socket.h.
Referenced by TGo4BufferQueue::Realloc(), and ReallocBuffer().
|
static |
Initial size for object receive buffer (TBuffer)
Definition at line 70 of file TGo4Socket.h.
Referenced by TGo4BufferQueue::FreeBuffer(), TGo4BufferQueue::NewEntry(), ReceiveBuffer(), and TGo4Socket().
|
static |
Raw transport buffer size
Definition at line 67 of file TGo4Socket.h.
Referenced by RecvRaw(), Send(), and TGo4Socket().
|
static |
We emulate the protected owner flag of the TBuffer class, needed for reallocation!
Definition at line 79 of file TGo4Socket.h.
Referenced by ReallocBuffer().
|
static |
|
static |
Time to sleep between client open retries
Definition at line 61 of file TGo4Socket.h.
Referenced by Open().
|
private |
Connected port number (of server socket which opened with portnumberscan)
Definition at line 102 of file TGo4Socket.h.
|
private |
Definition at line 108 of file TGo4Socket.h.
Referenced by GetBuffer(), ReceiveBuffer(), TGo4Socket(), and ~TGo4Socket().
|
private |
Definition at line 104 of file TGo4Socket.h.
Referenced by RecvRaw(), Send(), TGo4Socket(), and ~TGo4Socket().
|
private |
Server Socket (server mode only)
Definition at line 99 of file TGo4Socket.h.
Referenced by Open(), and ~TGo4Socket().
|
private |
root TSocket class doing the work
Definition at line 96 of file TGo4Socket.h.
Referenced by Close(), Open(), ReceiveBuffer(), Recv(), RecvRaw(), Send(), SendBuffer(), and ~TGo4Socket().