ROOT logo
ROOT » NET » NET » TPSocket

class TPSocket: public TSocket


TPSocket

This class implements parallel client sockets. A parallel socket is
an endpoint for communication between two machines. It is parallel
because several TSockets are open at the same time to the same
destination. This especially speeds up communication over Big Fat
Pipes (i.e. high bandwidth, high latency WAN connections).


Function Members (Methods)

public:
TPSocket(TInetAddress address, const char* service, Int_t size, Int_t tcpwindowsize = -1)
TPSocket(TInetAddress address, Int_t port, Int_t size, Int_t tcpwindowsize = -1)
TPSocket(const char* host, const char* service, Int_t size, Int_t tcpwindowsize = -1)
TPSocket(const char* host, Int_t port, Int_t size, Int_t tcpwindowsize = -1)
TPSocket(const char* host, Int_t port, Int_t size, TSocket* sock)
virtual~TPSocket()
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
static TSocket*TSocket::CreateAuthSocket(const char* url, Int_t size = 0, Int_t tcpwindowsize = -1, TSocket* s = 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)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
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
UInt_tTSocket::GetBytesRecv() const
UInt_tTSocket::GetBytesSent() const
static Int_tTSocket::GetClientProtocol()
Int_tTSocket::GetCompressionLevel() const
virtual Int_tGetDescriptor() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Int_tGetErrorCode() const
virtual const char*TObject::GetIconName() const
TInetAddressTSocket::GetInetAddress() const
TTimeStampTSocket::GetLastUsage()
virtual TInetAddressGetLocalInetAddress()
virtual Int_tTSocket::GetLocalPort()
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Int_tGetOption(ESockOptions opt, Int_t& val)
Int_tTSocket::GetPort() const
Int_tTSocket::GetRemoteProtocol() const
TSecContext*TSocket::GetSecContext() const
const char*TSocket::GetService() const
Int_tTSocket::GetServType() const
Int_tGetSize() 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
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
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
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()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static 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)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual Int_tTSocket::Reconnect()
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* buffer, Int_t length, ESendRecvOptions opt)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& 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)
virtual Int_tTSocket::SendObject(const TObject* obj, Int_t kind = kMESS_OBJECT)
virtual Int_tSendRaw(const void* buffer, Int_t length, ESendRecvOptions opt)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidTSocket::SetCompressionLevel(Int_t level = 1)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
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 opt, Int_t val)
voidTSocket::SetRemoteProtocol(Int_t rproto)
voidTSocket::SetSecContext(TSecContext* ctx)
voidTSocket::SetService(const char* service)
voidTSocket::SetServType(Int_t st)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
voidTSocket::SetUrl(const char* url)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& 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()
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
protected:
Bool_tTSocket::Authenticate(const char* user)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
Bool_tTSocket::RecvProcessIDs(TMessage* mess)
Bool_tTSocket::RecvStreamerInfos(TMessage* mess)
voidTSocket::SendProcessIDs(const TMessage& mess)
voidTSocket::SendStreamerInfos(const TMessage& mess)
voidTSocket::SetDescriptor(Int_t desc)
private:
TPSocket(const TPSocket&)
TPSocket(TSocket** pSockets, Int_t size)
virtual Option_t*GetOption() const
voidInit(Int_t tcpwindowsize, TSocket* sock = 0)
voidoperator=(const TPSocket&)

Data Members

public:
enum TSocket::EStatusBits { kIsUnix
};
enum TSocket::EInterest { kRead
kWrite
};
enum TSocket::EServiceType { kSOCKD
kROOTD
kPROOFD
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
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 from 0 (not compressed)
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:
Int_t*fReadBytesLeftbytes left to read for specified socket
TMonitor*fReadMonitormonitor read from parallel sockets
char**fReadPtrpointer to read buffer for specified socket
Int_tfSizenumber of parallel sockets
TSocket**fSocketsarray of parallel sockets
Int_t*fWriteBytesLeftbytes left to write for specified socket
TMonitor*fWriteMonitormonitor write on parallel sockets
char**fWritePtrpointer to write buffer for specified socket

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TPSocket(TInetAddress addr, const char *service, Int_t size, Int_t tcpwindowsize)
 Create a parallel socket. Connect to the named service at address addr.
 Use tcpwindowsize to specify the size of the receive buffer, it has
 to be specified here to make sure the window scale option is set (for
 tcpwindowsize > 65KB and for platforms supporting window scaling).
 Returns when connection has been accepted by remote side. Use IsValid()
 to check the validity of the socket. Every socket is added to the TROOT
 sockets list which will make sure that any open sockets are properly
 closed on program termination.
TPSocket(TInetAddress addr, Int_t port, Int_t size, Int_t tcpwindowsize)
 Create a parallel socket. Connect to the specified port # at address addr.
 Use tcpwindowsize to specify the size of the receive buffer, it has
 to be specified here to make sure the window scale option is set (for
 tcpwindowsize > 65KB and for platforms supporting window scaling).
 Returns when connection has been accepted by remote side. Use IsValid()
 to check the validity of the socket. Every socket is added to the TROOT
 sockets list which will make sure that any open sockets are properly
 closed on program termination.
TPSocket(const char *host, const char *service, Int_t size, Int_t tcpwindowsize)
 Create a parallel socket. Connect to named service on the remote host.
 Use tcpwindowsize to specify the size of the receive buffer, it has
 to be specified here to make sure the window scale option is set (for
 tcpwindowsize > 65KB and for platforms supporting window scaling).
 Returns when connection has been accepted by remote side. Use IsValid()
 to check the validity of the socket. Every socket is added to the TROOT
 sockets list which will make sure that any open sockets are properly
 closed on program termination.
TPSocket(const char *host, Int_t port, Int_t size, Int_t tcpwindowsize)
 Create a parallel socket. Connect to specified port # on the remote host.
 Use tcpwindowsize to specify the size of the receive buffer, it has
 to be specified here to make sure the window scale option is set (for
 tcpwindowsize > 65KB and for platforms supporting window scaling).
 Returns when connection has been accepted by remote side. Use IsValid()
 to check the validity of the socket. Every socket is added to the TROOT
 sockets list which will make sure that any open sockets are properly
 closed on program termination.
TPSocket(const char *host, Int_t port, Int_t size, TSocket *sock)
 Create a parallel socket on a connection already opened via
 TSocket sock.
 This constructor is provided to optimize TNetFile opening when
 instatiated via a call to TXNetFile.
 Returns when connection has been accepted by remote side. Use IsValid()
 to check the validity of the socket. Every socket is added to the TROOT
 sockets list which will make sure that any open sockets are properly
 closed on program termination.
TPSocket(TSocket** pSockets, Int_t size)
 Create a parallel socket. This ctor is called by TPServerSocket.
~TPSocket()
 Cleanup the parallel socket.
void Close(Option_t* opt = "")
 Close a parallel socket. If option is "force", calls shutdown(id,2) to
 shut down the connection. This will close the connection also
 for the parent of this process. Also called via the dtor (without
 option "force", call explicitely Close("force") if this is desired).
void Init(Int_t tcpwindowsize, TSocket* sock = 0)
 Create a parallel socket to the specified host.
TInetAddress GetLocalInetAddress()
 Return internet address of local host to which the socket is bound.
 In case of error TInetAddress::IsValid() returns kFALSE.
Int_t GetDescriptor() const
 Return socket descriptor
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. In case the TMessage::What
 has been or'ed with kMESS_ACK, the call will only return after having
 received an acknowledgement, making the sending process synchronous.
 Returns -4 in case of kNoBlock and errno == EWOULDBLOCK.
Int_t SendRaw(const void* buffer, Int_t length, ESendRecvOptions opt)
 Send a raw buffer of specified length. Returns the number of bytes
 send 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 -4 in case a non-blocking socket would
 block (i.e. there is nothing to be read). In those case mess == 0.
Int_t RecvRaw(void* buffer, Int_t length, ESendRecvOptions opt)
 Send a raw buffer of specified length. Returns the number of bytes
 sent or -1 in case of error.
Int_t SetOption(ESockOptions opt, Int_t val)
 Set socket options.
Int_t GetOption(ESockOptions opt, Int_t& val)
 Get socket options. Returns -1 in case of error.
Int_t GetErrorCode() const
 Returns error code. Meaning depends on context where it is called.
 If no error condition returns 0 else a value < 0.
TPSocket(TSocket** pSockets, Int_t size)
void operator=(const TPSocket& )
Option_t * GetOption() const
{ return TObject::GetOption(); }
Int_t Send(const TMessage &mess)
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)
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); }
Bool_t IsValid() const
{ return fSockets ? kTRUE : kFALSE; }
Int_t GetSize() const
{ return fSize; }