ROOT » PROOF » PROOFX » TXSocket

class TXSocket: public TSocket, public XrdClientAbsUnsolMsgHandler


TXSocket

High level handler of connections to xproofd.


Function Members (Methods)

public:
virtual~TXSocket()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual voidClose(Option_t* opt = "")
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
Bool_tCreate(Bool_t attach = kFALSE)
static TSocket*TSocket::CreateAuthSocket(const char* url, Int_t size = 0, Int_t tcpwindowsize = -1, TSocket* s = 0, Int_t* err = 0)
static TSocket*TSocket::CreateAuthSocket(const char* user, const char* host, Int_t port, Int_t size = 0, Int_t tcpwindowsize = -1, TSocket* s = 0, Int_t* err = 0)
voidCtrlC()
virtual voidTObject::Delete(Option_t* option = "")MENU
voidDisableTimeout()
voidDisconnectSession(Int_t id, Option_t* opt = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidDoError(int level, const char* location, const char* fmt, va_list va) const
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
voidEnableTimeout()
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tFlush()
UInt_tTSocket::GetBytesRecv() const
UInt_tTSocket::GetBytesSent() const
virtual Int_tGetClientID() const
virtual Int_tGetClientIDSize() const
static Int_tTSocket::GetClientProtocol()
Int_tTSocket::GetCompressionAlgorithm() const
Int_tTSocket::GetCompressionLevel() const
Int_tTSocket::GetCompressionSettings() const
virtual Int_tTSocket::GetDescriptor() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Int_tTSocket::GetErrorCode() const
virtual const char*TObject::GetIconName() const
TInetAddressTSocket::GetInetAddress() const
Int_tGetInterrupt(Bool_t& forward)
TTimeStampTSocket::GetLastUsage()
virtual TInetAddressTSocket::GetLocalInetAddress()
virtual Int_tTSocket::GetLocalPort()
Int_tGetLogConnID() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
Int_tGetOpenError() const
virtual Int_tTSocket::GetOption(ESockOptions opt, Int_t& val)
Int_tTSocket::GetPort() const
Int_tTSocket::GetRemoteProtocol() const
TSecContext*TSocket::GetSecContext() const
const char*TSocket::GetService() const
Int_tGetServType() const
Int_tGetSessionID() const
static ULong64_tTSocket::GetSocketBytesRecv()
static ULong64_tTSocket::GetSocketBytesSent()
Int_tTSocket::GetTcpWindowSize() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
const char*TSocket::GetUrl() const
Int_tGetXrdProofdVersion() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTSocket::IsAuthenticated() const
Bool_tIsAWait()
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tIsInterrupt()
Bool_tTObject::IsOnHeap() const
Bool_tIsServProofd()
virtual Bool_tTNamed::IsSortable() const
virtual Bool_tIsValid() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
static voidTSocket::NetError(const char* where, Int_t error)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TXSocket&operator=(const TXSocket&)
virtual voidTObject::Paint(Option_t* option = "")
Bool_tPing(const char* ord = 0)
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual UnsolRespProcResultProcessUnsolicitedMsg(XrdClientUnsolMsgSender* s, XrdClientMessage* msg)
virtual Int_tTObject::Read(const char* name)
virtual Int_tReconnect()
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual Int_tRecv(TMessage*& mess)
virtual Int_tRecv(Int_t& status, Int_t& kind)
virtual Int_tRecv(char* mess, Int_t max)
virtual Int_tRecv(char* mess, Int_t max, Int_t& kind)
virtual Int_tRecvRaw(void* buf, Int_t len, ESendRecvOptions opt = kDefault)
voidRemoteTouch()
virtual voidRemoveClientID()
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
virtual Int_tTSocket::Select(Int_t interest = kRead, Long_t timeout = -1)
virtual Int_tSend(const TMessage& mess)
virtual Int_tSend(Int_t kind)
virtual Int_tSend(Int_t status, Int_t kind)
virtual Int_tSend(const char* mess, Int_t kind = kMESS_STRING)
TObjString*SendCoordinator(Int_t kind, const char* msg = 0, Int_t int2 = 0, Long64_t l64 = 0, Int_t int3 = 0, const char* opt = 0)
Int_tSendInterrupt(Int_t type)
virtual Int_tTSocket::SendObject(const TObject* obj, Int_t kind = kMESS_OBJECT)
virtual Int_tSendRaw(const void* buf, Int_t len, ESendRecvOptions opt = kDontBlock)
voidSendUrgent(Int_t type, Int_t int1, Int_t int2)
voidSetAWait(Bool_t w = kTRUE)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidSetClientID(Int_t)
voidTSocket::SetCompressionAlgorithm(Int_t algorithm = 0)
voidTSocket::SetCompressionLevel(Int_t level = 1)
voidTSocket::SetCompressionSettings(Int_t settings = 1)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetInterrupt(Bool_t i = kTRUE)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual Int_tSetOption(ESockOptions, Int_t)
voidTSocket::SetRemoteProtocol(Int_t rproto)
voidTSocket::SetSecContext(TSecContext* ctx)
voidSetSendOpt(ESendRecvOptions o)
voidTSocket::SetService(const char* service)
voidTSocket::SetServType(Int_t st)
voidSetSessionID(Int_t id)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
voidTSocket::SetUrl(const char* url)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
voidTSocket::Touch()
TXSocket(const TXSocket&)
TXSocket(const char* url, Char_t mode = 'M', Int_t psid = -1, Char_t ver = -1, const char* logbuf = 0, Int_t loglevel = -1, TXHandler* handler = 0)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
private:
Int_tGetLowSocket() const
static voidInitEnvs()
Int_tPickUpReady()
TXSockBuf*PopUpSpare(Int_t sz)
voidPostMsg(Int_t type, const char* msg = 0)
voidPushBackSpare()
static voidSetLocation(const char* loc = "")

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TSocket::EStatusBitsTSocket::kBrokenConn
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TSocket::EStatusBitsTSocket::kIsUnix
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TSocket::EServiceTypeTSocket::kPROOFD
static TSocket::EServiceTypeTSocket::kROOTD
static TSocket::EInterestTSocket::kRead
static TSocket::EServiceTypeTSocket::kSOCKD
static TObject::(anonymous)TObject::kSingleKey
static TXSocket::EUrgentMsgTypekStopProcess
static TSocket::EInterestTSocket::kWrite
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
TInetAddressTSocket::fAddressremote internet address and port #
TBitsTSocket::fBitsInfobits array to mark TStreamerInfo classes already sent
UInt_tTSocket::fBytesRecvtotal bytes received over this socket
UInt_tTSocket::fBytesSenttotal bytes sent using this socket
Int_tTSocket::fCompressCompression level and algorithm
TTimeStampTSocket::fLastUsageTime stamp of last usage
TVirtualMutex*TSocket::fLastUsageMtxProtect last usage setting / reading
TInetAddressTSocket::fLocalAddresslocal internet address and port #
TStringTNamed::fNameobject identifier
Int_tTSocket::fRemoteProtocolprotocol of remote daemon
TSecContext*TSocket::fSecContextafter a successful Authenticate call
TSocket::EServiceTypeTSocket::fServTyperemote service type
TStringTSocket::fServicename of service (matches remote port #)
Int_tTSocket::fSocketsocket descriptor
Int_tTSocket::fTcpWindowSizeTCP window size (default 65535);
TStringTNamed::fTitleobject title
TList*TSocket::fUUIDslist of TProcessIDs already sent through the socket
TStringTSocket::fUrlneeds this for special authentication options
static ULong64_tTSocket::fgBytesRecvtotal bytes received by all socket objects
static ULong64_tTSocket::fgBytesSenttotal bytes sent by all socket objects
static Int_tTSocket::fgClientProtocolclient "protocol" version
private:
TMutex*fAMtxTo protect async msg queue
list<TXSockBuf*>fAQuelist of asynchronous messages
TSemaphorefASemControl access to conn async msg queue
Bool_tfAWaitkTRUE if waiting at the async msg queue
TSemaphorefAsynProcControl actions while processing async messages
TXSockBuf*fBufCurcurrent read buffer
TStringfBufferContainer for exchanging information
Int_tfByteCurcurrent position in the first buffer
Int_tfByteLeftbytes left in the first buffer
XrdProofConn*fConninstance of the underlying connection module
Bool_tfDontTimeoutIf true wait forever for incoming messages
TXHandler*fHandlerHandler of asynchronous events (input, error)
TStringfHostRemote host
Bool_tfIForwardWhether the interrupt should be propagated
kXR_int32fILevHighest received interrupt
TMutex*fIMtxTo protect interrupt queue
Int_tfLogLevelLog level to be transmitted to servers
charfMode'e' (def) or 'i' (internal - proofsrv)
Int_tfPid
Int_tfPortRemote port
Bool_tfRDInterruptTo interrupt waiting for messages
TObject*fReferenceGeneric object reference of this socket
kXR_int32fSendOptOptions for sending messages
Short_tfSessionIDproofsrv: remote ID of connected session
TStringfUserUsername used for login
Int_tfXrdProofdVersion
static Bool_tfgInitDoneAvoid initializing more than once
static TStringfgLocLocation string
static TXSockPipefgPipePipe for input monitoring
static TMutexfgSMtxTo protect spare list
static list<TXSockBuf*>fgSQuelist of spare buffers

Class Charts

Inheritance Chart:
TObject
TNamed
TSocket
XrdClientAbsUnsolMsgHandler
TXSocket
TXUnixSocket

Function documentation

void DoError(int level, const char* location, const char* fmt, va_list va) const
 Interface to ErrorHandler (protected).
TXSocket(const char* url, Char_t mode = 'M', Int_t psid = -1, Char_t ver = -1, const char* logbuf = 0, Int_t loglevel = -1, TXHandler* handler = 0)
 Constructor
 Open the connection to a remote XrdProofd instance and start a PROOF
 session.
 The mode 'm' indicates the role of this connection:
     'a'      Administrator; used by an XPD to contact the head XPD
     'i'      Internal; used by a TXProofServ to call back its creator
              (see XrdProofUnixConn)
     'C'      PROOF manager: open connection only (do not start a session)
     'M'      Client creating a top master
     'A'      Client attaching to top master
     'm'      Top master creating a submaster
     's'      Master creating a slave
 The buffer 'logbuf' is a null terminated string to be sent over at
 login.
TXSocket(const TXSocket& )
 TXSocket copy ctor.
TXSocket& operator=(const TXSocket& )
 TXSocket assignment operator.
~TXSocket()
 Destructor
void SetLocation(const char* loc = "")
 Set location string
void SetSessionID(Int_t id)
 Set session ID to 'id'. If id < 0, disable also the asynchronous handler.
void DisconnectSession(Int_t id, Option_t* opt = "")
 Disconnect a session. Use opt= "S" or "s" to
 shutdown remote session.
 Default is opt = "".
void Close(Option_t* opt = "")
 Close connection. Available options are (case insensitive)
   'P'   force closing of the underlying physical connection
   'S'   shutdown remote session, is any
 A session ID can be given using #...# signature, e.g. "#1#".
 Default is opt = "".
UnsolRespProcResult ProcessUnsolicitedMsg(XrdClientUnsolMsgSender* s, XrdClientMessage* msg)
 We are here if an unsolicited response comes from a logical conn
 The response comes in the form of an XrdClientMessage *, that must NOT be
 destroyed after processing. It is destroyed by the first sender.
 Remember that we are in a separate thread, since unsolicited
 responses are asynchronous by nature.
void PostMsg(Int_t type, const char* msg = 0)
 Post a message of type 'type' into the read messages queue.
 If 'msg' is defined it is also added as TString.
 This is used, for example, with kPROOF_FATAL to force the main thread
 to mark this socket as bad, avoiding race condition when a worker
 dies while in processing state.
Bool_t IsServProofd()
 Return kTRUE if the remote server is a 'proofd'
Int_t GetInterrupt(Bool_t& forward)
 Get latest interrupt level and reset it; if the interrupt has to be
 propagated to lower stages forward will be kTRUE after the call
Int_t Flush()
 Flush the asynchronous queue.
 Typically called when a kHardInterrupt is received.
 Returns number of bytes in flushed buffers.
Bool_t Create(Bool_t attach = kFALSE)
 This method sends a request for creation of (or attachment to) a remote
 server application.
Int_t SendRaw(const void* buf, Int_t len, ESendRecvOptions opt = kDontBlock)
 Send a raw buffer of specified length.
 Use opt = kDontBlock to ask xproofd to push the message into the proofsrv.
 (by default is appended to a queue waiting for a request from proofsrv).
 Returns the number of bytes sent or -1 in case of error.
Bool_t Ping(const char* ord = 0)
 Ping functionality: contact the server to check its vitality.
 If external, the server waits for a reply from the server
 Returns kTRUE if OK or kFALSE in case of error.
void RemoteTouch()
 Remote touch functionality: contact the server to proof our vitality.
 No reply from server is expected.
void CtrlC()
 Interrupt the remote protocol instance. Used to propagate Ctrl-C.
 No reply from server is expected.
Int_t PickUpReady()
 Wait and pick-up next buffer from the asynchronous queue
TXSockBuf * PopUpSpare(Int_t sz)
 Pop-up a buffer of at least size bytes from the spare list
 If none is found either one is reallocated or a new one
 created
void PushBackSpare()
 Release read buffer giving back to the spare list
Int_t RecvRaw(void* buf, Int_t len, ESendRecvOptions opt = kDefault)
 Receive a raw buffer of specified length bytes.
Int_t SendInterrupt(Int_t type)
 Send urgent message (interrupt) to remote server
 Returns 0 or -1 in case of error.
Int_t Send(const TMessage& mess)
 Send a TMessage object. Returns the number of bytes in the TMessage
 that were sent and -1 in case of error.
Int_t Recv(TMessage*& mess)
 Receive a TMessage object. The user must delete the TMessage object.
 Returns length of message in bytes (can be 0 if other side of connection
 is closed) or -1 in case of error or -5 if pipe broken (connection invalid).
 In those case mess == 0.
TObjString * SendCoordinator(Int_t kind, const char* msg = 0, Int_t int2 = 0, Long64_t l64 = 0, Int_t int3 = 0, const char* opt = 0)
 Send message to intermediate coordinator.
 If any output is due, this is returned as an obj string to be
 deleted by the caller
void SendUrgent(Int_t type, Int_t int1, Int_t int2)
 Send urgent message to counterpart; 'type' specifies the type of
 the message (see TXSocket::EUrgentMsgType), and 'int1', 'int2'
 two containers for additional information.
void InitEnvs()
 Init environment variables for XrdClient
Int_t Reconnect()
 Try reconnection after failure
Int_t GetLowSocket() const
 Auxilliary
{ return (fConn ? fConn->GetLowSocket() : -1); }
Int_t GetClientID() const
{ return -1; }
Int_t GetClientIDSize() const
{ return 1; }
Int_t GetLogConnID() const
{ return (fConn ? fConn->GetLogConnID() : -1); }
Int_t GetOpenError() const
{ return (fConn ? fConn->GetOpenError() : -1); }
Int_t GetServType() const
{ return (fConn ? fConn->GetServType() : -1); }
Int_t GetSessionID() const
{ return (fConn ? fConn->GetSessionID() : -1); }
Int_t GetXrdProofdVersion() const
{ return fXrdProofdVersion; }
Bool_t IsValid() const
{ return (fConn ? (fConn->IsValid()) : kFALSE); }
void RemoveClientID()
{ }
void SetClientID(Int_t )
{ }
void SetSendOpt(ESendRecvOptions o)
{ fSendOpt = o; }
Int_t Send(const TMessage& mess)
 Send interfaces
Int_t Send(Int_t kind)
{ return TSocket::Send(kind); }
Int_t Send(Int_t status, Int_t kind)
{ return TSocket::Send(status, kind); }
Int_t Recv(TMessage*& mess)
 Recv interfaces
Int_t Recv(Int_t& status, Int_t& kind)
{ return TSocket::Recv(status, kind); }
Int_t Recv(char* mess, Int_t max)
{ return TSocket::Recv(mess, max); }
void SetInterrupt(Bool_t i = kTRUE)
 Interrupt the low level socket
Bool_t IsInterrupt()
 Set / Check async msg queue waiting status
{ R__LOCKGUARD(fAMtx); return fRDInterrupt; }
void SetAWait(Bool_t w = kTRUE)
{ R__LOCKGUARD(fAMtx); fAWait = w; }
Bool_t IsAWait()
{ R__LOCKGUARD(fAMtx); return fAWait; }
Int_t SetOption(ESockOptions , Int_t )
 Standard options cannot be set
{ return 0; }
void DisableTimeout()
 Disable / Enable read timeout
void EnableTimeout()