GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4Socket Class Reference

#include <TGo4Socket.h>

Public Member Functions

 TGo4Socket (Bool_t IsClient)
 
virtual ~TGo4Socket ()
 
virtual Int_t Close (Option_t *opt="")
 
const TBuffer * GetBuffer () const
 Access the internal receiving buffer of this socket.
 
Int_t GetPort () const
 
Bool_t IsClientMode () const
 
Bool_t IsOpen () const
 
virtual Int_t Open (const char *host, Int_t port, Bool_t keepservsock=kFALSE)
 
Int_t ReceiveBuffer ()
 Receive raw buffer and fill the internal TBuffer of this socket instance with it.
 
virtual TObject * Recv (const char *name=nullptr)
 
virtual char * RecvRaw (const char *name=nullptr)
 
virtual Int_t Send (const char *name)
 
virtual Int_t Send (TObject *obj)
 
Int_t SendBuffer (TBuffer *buf)
 Send raw buffer of external TBuffer object.
 

Static Public Attributes

static const char * fgcGOON = "-I- go on"
 First connection string, we are told to go on...
 
static const Int_t fgiBUFEXTRASPACE =8
 ROOT internal constant: extra space for reallocating object receive buffer (TBuffer)
 
static const Int_t fgiBUFINITSIZE =65536
 Initial size for object receive buffer (TBuffer)
 
static const Int_t fgiBUFLENGTH =256
 Raw transport buffer size.
 
static const Int_t fgiOPENCYCLES =6
 Number of retries for client open.
 
static const Int_t fguOPENWAIT =200
 Time to sleep between client open retries.
 

Protected Member Functions

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

Private Attributes

Bool_t fbClientMode {kFALSE}
 True if instance runs in as client.
 
Bool_t fbOpen {kFALSE}
 True if connection is open.
 
Int_t fiPort {0}
 Connected port number (of server socket which opened with portnumberscan)
 
TBuffer * fxBuffer {nullptr}
 aggregation 1
 
char * fxLocalBuffer {nullptr}
 
TServerSocket * fxServerSocket {nullptr}
 Server Socket (server mode only)
 
TSocket * fxSocket {nullptr}
 root TSocket class doing the work
 

Detailed Description

Definition at line 24 of file TGo4Socket.h.

Constructor & Destructor Documentation

◆ TGo4Socket() [1/2]

◆ ~TGo4Socket()

TGo4Socket::~TGo4Socket ( )
virtual

Definition at line 64 of file TGo4Socket.cxx.

References fxBuffer, fxLocalBuffer, fxServerSocket, fxSocket, and GO4TRACE.

◆ TGo4Socket() [2/2]

TGo4Socket::TGo4Socket ( )
protecteddelete

Member Function Documentation

◆ Close()

Int_t TGo4Socket::Close ( Option_t * opt = "")
virtual

◆ GetBuffer()

const TBuffer * TGo4Socket::GetBuffer ( ) const
inline

Access the internal receiving buffer of this socket.

Definition at line 59 of file TGo4Socket.h.

References fxBuffer.

◆ GetPort()

Int_t TGo4Socket::GetPort ( ) const
inline

Definition at line 41 of file TGo4Socket.h.

References fiPort.

Referenced by TGo4TaskHandler::WaitGetPort().

◆ IsClientMode()

Bool_t TGo4Socket::IsClientMode ( ) const
inline

Definition at line 39 of file TGo4Socket.h.

References fbClientMode.

◆ IsOpen()

Bool_t TGo4Socket::IsOpen ( ) const
inline

◆ Open()

Int_t TGo4Socket::Open ( const char * host,
Int_t port,
Bool_t keepservsock = kFALSE )
virtual

◆ ReallocBuffer()

void TGo4Socket::ReallocBuffer ( TBuffer * buffer,
Int_t oldsize,
Int_t newsize )
protected

Reallocate the fixed input buffer if necessary.

Definition at line 461 of file TGo4Socket.cxx.

References fgiBUFEXTRASPACE, and TGo4LockGuard.

Referenced by ReceiveBuffer().

◆ ReceiveBuffer()

Int_t TGo4Socket::ReceiveBuffer ( )

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

Definition at line 273 of file TGo4Socket.cxx.

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

◆ Recv()

TObject * TGo4Socket::Recv ( const char * name = nullptr)
virtual

Definition at line 431 of file TGo4Socket.cxx.

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

◆ RecvRaw()

char * TGo4Socket::RecvRaw ( const char * name = nullptr)
virtual

◆ Send() [1/2]

Int_t TGo4Socket::Send ( const char * name)
virtual

Definition at line 366 of file TGo4Socket.cxx.

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

◆ Send() [2/2]

◆ SendBuffer()

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 220 of file TGo4Socket.cxx.

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

Field Documentation

◆ fbClientMode

Bool_t TGo4Socket::fbClientMode {kFALSE}
private

True if instance runs in as client.

Definition at line 88 of file TGo4Socket.h.

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

◆ fbOpen

Bool_t TGo4Socket::fbOpen {kFALSE}
private

True if connection is open.

Definition at line 91 of file TGo4Socket.h.

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

◆ fgcGOON

const char * TGo4Socket::fgcGOON = "-I- go on"
static

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

Definition at line 77 of file TGo4Socket.h.

Referenced by Open().

◆ fgiBUFEXTRASPACE

const Int_t TGo4Socket::fgiBUFEXTRASPACE =8
static

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

Definition at line 74 of file TGo4Socket.h.

Referenced by ReallocBuffer().

◆ fgiBUFINITSIZE

const Int_t TGo4Socket::fgiBUFINITSIZE =65536
static

Initial size for object receive buffer (TBuffer)

Definition at line 71 of file TGo4Socket.h.

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

◆ fgiBUFLENGTH

const Int_t TGo4Socket::fgiBUFLENGTH =256
static

Raw transport buffer size.

Definition at line 68 of file TGo4Socket.h.

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

◆ fgiOPENCYCLES

const Int_t TGo4Socket::fgiOPENCYCLES =6
static

Number of retries for client open.

Definition at line 65 of file TGo4Socket.h.

Referenced by Open().

◆ fguOPENWAIT

const Int_t TGo4Socket::fguOPENWAIT =200
static

Time to sleep between client open retries.

Definition at line 62 of file TGo4Socket.h.

Referenced by Open().

◆ fiPort

Int_t TGo4Socket::fiPort {0}
private

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

Definition at line 100 of file TGo4Socket.h.

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

◆ fxBuffer

TBuffer* TGo4Socket::fxBuffer {nullptr}
private

aggregation 1

Definition at line 106 of file TGo4Socket.h.

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

◆ fxLocalBuffer

char* TGo4Socket::fxLocalBuffer {nullptr}
private

Definition at line 102 of file TGo4Socket.h.

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

◆ fxServerSocket

TServerSocket* TGo4Socket::fxServerSocket {nullptr}
private

Server Socket (server mode only)

Definition at line 97 of file TGo4Socket.h.

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

◆ fxSocket

TSocket* TGo4Socket::fxSocket {nullptr}
private

root TSocket class doing the work

Definition at line 94 of file TGo4Socket.h.

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


The documentation for this class was generated from the following files: