23 #define DFLT_CONNECTMAXTRY 10
28 #ifndef ROOT_TSemaphore
46 #ifndef ROOT_XrdProofConn
49 #ifndef XRC_UNSOLMSG_H
50 #include "XrdClient/XrdClientUnsolMsg.hh"
154 const char *logbuf = 0,
Int_t loglevel = -1,
TXHandler *handler = 0);
166 const char *location,
const char *fmt, va_list va)
const;
221 if (i && fAWait) fASem.
Post(); }
void SetSendOpt(ESendRecvOptions o)
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.
static void SetLocation(const char *loc="")
Set location string.
virtual void RemoveClientID()
virtual void SetClientID(Int_t)
Int_t Send(const char *mess, Int_t kind=kMESS_STRING)
Send a character string buffer.
Int_t Recv(Int_t &status, Int_t &kind)
Receives a status and a message type.
Int_t SendRaw(const void *buf, Int_t len, ESendRecvOptions opt=kDontBlock)
Send a raw buffer of specified length.
void SetLoc(const char *loc="")
Int_t Recv(char *mess, Int_t max)
Receive a character string message of maximum max length.
Int_t GetXrdProofdVersion() const
Collectable string class.
virtual void Close(Option_t *opt="")
Close connection.
static Long64_t BuffMem()
Return the currently allocated memory.
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
virtual Int_t GetClientID() const
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
Int_t TryWait()
If semaphore value is > 0 then decrement it and return 0.
virtual 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...
virtual ~TXSocket()
Destructor.
Int_t Recv(char *mess, Int_t max, Int_t &kind)
Receive a character string message of maximum max length.
Int_t GetServType() const
void SetInterrupt(Bool_t i=kTRUE)
void SetSessionID(Int_t id)
Set session ID to 'id'. If id < 0, disable also the asynchronous handler.
TXSocket * GetLastReady()
Return last ready socket.
void RemoteTouch()
Remote touch functionality: contact the server to proof our vitality.
Int_t Post(TSocket *s)
Write a byte to the global pipe to signal new availibility of new messages.
static Long64_t fgBuffMem
virtual ~TXSemaphoreGuard()
void SetInterrupt()
Interrupt the underlying socket.
Int_t Clean(TSocket *s)
Read a byte to the global pipe to synchronize message pickup.
Int_t RecvRaw(void *buf, Int_t len, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
#define ClassDef(name, id)
static void InitEnvs()
Init environment variables for XrdClient.
static std::list< TXSockBuf * > fgSQue
Int_t Send(const TMessage &mess)
Send a TMessage object.
Int_t GetInterrupt(Bool_t &forward)
Get latest interrupt level and reset it; if the interrupt has to be propagated to lower stages forwar...
Int_t GetLowSocket() const
virtual Int_t GetClientIDSize() const
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...
Bool_t IsServProofd()
Return kTRUE if the remote server is a 'proofd'.
Bool_t Create(Bool_t attach=kFALSE)
This method sends a request for creation of (or attachment to) a remote server application.
Int_t Flush()
Flush the asynchronous queue.
TXSockBuf(Char_t *bp=0, Int_t sz=0, Bool_t own=1)
constructor
void SetAWait(Bool_t w=kTRUE)
void PostMsg(Int_t type, const char *msg=0)
Post a message of type 'type' into the read messages queue.
Bool_t Ping(const char *ord=0)
Ping functionality: contact the server to check its vitality.
std::list< TXSockBuf * > fAQue
Int_t Post()
If any threads are blocked in Wait(), wake one of them up and increment the value of the semaphore...
Int_t Flush(TSocket *s)
Remove any reference to socket 's' from the global pipe and ready-socket queue.
TXSemaphoreGuard(TSemaphore *sem)
virtual ~TXSockPipe()
Destructor.
virtual Int_t Reconnect()
Try reconnection after failure.
Int_t Send(Int_t status, Int_t kind)
Send a status and a single message opcode.
void DisconnectSession(Int_t id, Option_t *opt="")
Disconnect a session.
int GetLowSocket()
Return the socket descriptor of the underlying connection.
Int_t Send(Int_t kind)
Send a single message opcode.
bool IsValid() const
Test validity of this connection.
TSocket & operator=(const TSocket &)
#define R__LOCKGUARD(mutex)
TXSockPipe(const char *loc="")
Constructor.
Int_t Recv(TMessage *&mess)
Receive a TMessage object.
Int_t GetLogConnID() const
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
void DumpReadySock()
Dump content of the ready socket list.
Mother of all ROOT objects.
Int_t SetOption(ESockOptions, Int_t)
Set socket options.
void PushBackSpare()
Release read buffer giving back to the spare list.
Int_t PickUpReady()
Wait and pick-up next buffer from the asynchronous queue.
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.
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::EUrgentMs...
Int_t GetSessionID() const
static void SetMemMax(Long64_t memmax)
Return the max allocated memory allowed.
Int_t SendInterrupt(Int_t type)
Send urgent message (interrupt) to remote server Returns 0 or -1 in case of error.
void DoError(int level, const char *location, const char *fmt, va_list va) const
Interface to ErrorHandler (protected).
short GetSessionID() const
Int_t GetOpenError() const
void Resize(Int_t sz)
resize socket buffer
void CtrlC()
Interrupt the remote protocol instance.
static Long64_t GetMemMax()
Return the max allocated memory allowed.