ROOT » NET » NET » TSocket

class TSocket: public TNamed


TSocket

This class implements client sockets. A socket is an endpoint for
communication between two machines.
The actual work is done via the TSystem class (either TUnixSystem
or TWinNTSystem).


Function Members (Methods)

public:
virtual~TSocket()
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*CreateAuthSocket(const char* url, Int_t size = 0, Int_t tcpwindowsize = -1, TSocket* s = 0, Int_t* err = 0)
static 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)
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_tGetBytesRecv() const
UInt_tGetBytesSent() const
static Int_tGetClientProtocol()
Int_tGetCompressionAlgorithm() const
Int_tGetCompressionLevel() const
Int_tGetCompressionSettings() const
virtual Int_tGetDescriptor() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Int_tGetErrorCode() const
virtual const char*TObject::GetIconName() const
TInetAddressGetInetAddress() const
TTimeStampGetLastUsage()
virtual TInetAddressGetLocalInetAddress()
virtual Int_tGetLocalPort()
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_tGetPort() const
Int_tGetRemoteProtocol() const
TSecContext*GetSecContext() const
const char*GetService() const
Int_tGetServType() const
static ULong64_tGetSocketBytesRecv()
static ULong64_tGetSocketBytesSent()
Int_tGetTcpWindowSize() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
const char*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_tIsAuthenticated() 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 voidNetError(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)
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_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* buffer, Int_t length, ESendRecvOptions opt = kDefault)
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_tSelect(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_tSendObject(const TObject* obj, Int_t kind = kMESS_OBJECT)
virtual Int_tSendRaw(const void* buffer, Int_t length, ESendRecvOptions opt = kDefault)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetCompressionAlgorithm(Int_t algorithm = 0)
voidSetCompressionLevel(Int_t level = 1)
voidSetCompressionSettings(Int_t settings = 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)
voidSetRemoteProtocol(Int_t rproto)
voidSetSecContext(TSecContext* ctx)
voidSetService(const char* service)
voidSetServType(Int_t st)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetUrl(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
voidTouch()
TSocket(const char* sockpath)
TSocket(Int_t descriptor)
TSocket(const TSocket& s)
TSocket(Int_t descriptor, const char* sockpath)
TSocket(TInetAddress address, const char* service, Int_t tcpwindowsize = -1)
TSocket(TInetAddress address, Int_t port, Int_t tcpwindowsize = -1)
TSocket(const char* host, const char* service, Int_t tcpwindowsize = -1)
TSocket(const char* host, Int_t port, Int_t tcpwindowsize = -1)
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_tAuthenticate(const char* user)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
Bool_tRecvProcessIDs(TMessage* mess)
Bool_tRecvStreamerInfos(TMessage* mess)
voidSendProcessIDs(const TMessage& mess)
voidSendStreamerInfos(const TMessage& mess)
voidSetDescriptor(Int_t desc)
TSocket()
private:
virtual Option_t*GetOption() const
TSocket&operator=(const TSocket&)

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TSocket::EStatusBitskBrokenConn
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::EStatusBitskIsUnix
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TSocket::EServiceTypekPROOFD
static TSocket::EServiceTypekROOTD
static TSocket::EInterestkRead
static TSocket::EServiceTypekSOCKD
static TObject::(anonymous)TObject::kSingleKey
static TSocket::EInterestkWrite
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
TInetAddressfAddressremote internet address and port #
TBitsfBitsInfobits array to mark TStreamerInfo classes already sent
UInt_tfBytesRecvtotal bytes received over this socket
UInt_tfBytesSenttotal bytes sent using this socket
Int_tfCompressCompression level and algorithm
TTimeStampfLastUsageTime stamp of last usage
TVirtualMutex*fLastUsageMtxProtect last usage setting / reading
TInetAddressfLocalAddresslocal internet address and port #
TStringTNamed::fNameobject identifier
Int_tfRemoteProtocolprotocol of remote daemon
TSecContext*fSecContextafter a successful Authenticate call
TSocket::EServiceTypefServTyperemote service type
TStringfServicename of service (matches remote port #)
Int_tfSocketsocket descriptor
Int_tfTcpWindowSizeTCP window size (default 65535);
TStringTNamed::fTitleobject title
TList*fUUIDslist of TProcessIDs already sent through the socket
TStringfUrlneeds this for special authentication options
static ULong64_tfgBytesRecvtotal bytes received by all socket objects
static ULong64_tfgBytesSenttotal bytes sent by all socket objects
static Int_tfgClientProtocolclient "protocol" version

Class Charts

Inheritance Chart:
TObject
TNamed
TSocket
TPSocket
TSSLSocket
TServerSocket
TPServerSocket
TXSocket
TXUnixSocket

Function documentation

TSocket(TInetAddress address, const char* service, Int_t tcpwindowsize = -1)
 Create a 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.
TSocket(TInetAddress address, Int_t port, Int_t tcpwindowsize = -1)
 Create a 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.
TSocket(const char* host, const char* service, Int_t tcpwindowsize = -1)
 Create a 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.
TSocket(const char* host, Int_t port, Int_t tcpwindowsize = -1)
 Create a socket; see CreateAuthSocket for the form of url.
 Connect to the specified port # on the remote host.
 If user is specified in url, try authentication as user.
 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.
TSocket(const char* sockpath)
 Create a socket in the Unix domain on 'sockpath'.
 Returns when connection has been accepted by the server. 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.
TSocket(Int_t descriptor)
 Create a socket. The socket will adopt previously opened TCP socket with
 descriptor desc.
TSocket(Int_t descriptor, const char* sockpath)
 Create a socket. The socket will adopt previously opened Unix socket with
 descriptor desc. The sockpath arg is for info purposes only. Use
 this method to adopt e.g. a socket created via socketpair().
TSocket(const TSocket& s)
 TSocket copy ctor.
void Close(Option_t* opt = "")
 Close the 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 explicitly Close("force") if this is desired).
TInetAddress GetLocalInetAddress()
 Return internet address of local host to which the socket is bound.
 In case of error TInetAddress::IsValid() returns kFALSE.
Int_t GetLocalPort()
 Return the local port # to which the socket is bound.
 In case of error return -1.
Int_t Select(Int_t interest = kRead, Long_t timeout = -1)
 Waits for this socket to change status. If interest=kRead,
 the socket will be watched to see if characters become available for
 reading; if interest=kWrite the socket will be watched to
 see if a write will not block.
 The argument 'timeout' specifies a maximum time to wait in millisec.
 Default no timeout.
 Returns 1 if a change of status of interest has been detected within
 timeout; 0 in case of timeout; < 0 if an error occured.
Int_t Send(Int_t kind)
 Send a single message opcode. Use kind (opcode) to set the
 TMessage "what" field. Returns the number of bytes that were sent
 (always sizeof(Int_t)) and -1 in case of error. In case the kind has
 been or'ed with kMESS_ACK, the call will only return after having
 received an acknowledgement, making the sending process synchronous.
Int_t Send(Int_t status, Int_t kind)
 Send a status and a single message opcode. Use kind (opcode) to set the
 TMessage "what" field. Returns the number of bytes that were sent
 (always 2*sizeof(Int_t)) and -1 in case of error. In case the kind has
 been or'ed with kMESS_ACK, the call will only return after having
 received an acknowledgement, making the sending process synchronous.
Int_t Send(const char* mess, Int_t kind = kMESS_STRING)
 Send a character string buffer. Use kind to set the TMessage "what" field.
 Returns the number of bytes in the string str that were sent and -1 in
 case of error. In case the kind has been or'ed with kMESS_ACK, the call
 will only return after having received an acknowledgement, making the
 sending process synchronous.
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.
 Returns -5 if pipe broken or reset by peer (EPIPE || ECONNRESET).
 support for streaming TStreamerInfo added by Rene Brun May 2008
 support for streaming TProcessID added by Rene Brun June 2008
Int_t SendObject(const TObject* obj, Int_t kind = kMESS_OBJECT)
 Send an object. Returns the number of bytes sent and -1 in case of error.
 In case the "kind" has been or'ed with kMESS_ACK, the call will only
 return after having received an acknowledgement, making the sending
 synchronous.
Int_t SendRaw(const void* buffer, Int_t length, ESendRecvOptions opt = kDefault)
 Send a raw buffer of specified length. Using option kOob one can send
 OOB data. Returns the number of bytes sent or -1 in case of error.
 Returns -4 in case of kNoBlock and errno == EWOULDBLOCK.
 Returns -5 if pipe broken or reset by peer (EPIPE || ECONNRESET).
void SendStreamerInfos(const TMessage& mess)
 Check if TStreamerInfo must be sent. The list of TStreamerInfo of classes
 in the object in the message is in the fInfos list of the message.
 We send only the TStreamerInfos not yet sent on this socket.
void SendProcessIDs(const TMessage& mess)
 Check if TProcessIDs must be sent. The list of TProcessIDs
 in the object in the message is found by looking in the TMessage bits.
 We send only the TProcessIDs not yet send on this socket.
Int_t Recv(char* mess, Int_t max)
 Receive a character string message of maximum max length. The expected
 message must be of type kMESS_STRING. Returns length of received string
 (can be 0 if otherside 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).
Int_t Recv(char* mess, Int_t max, Int_t& kind)
 Receive a character string message of maximum max length. Returns in
 kind the message type. Returns length of received string+4 (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).
Int_t Recv(Int_t& status, Int_t& kind)
 Receives a status and a message type. Returns length of received
 integers, 2*sizeof(Int_t) (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).
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) or -5 if pipe broken
 or reset by peer (EPIPE || ECONNRESET). In those case mess == 0.
Int_t RecvRaw(void* buffer, Int_t length, ESendRecvOptions opt = kDefault)
 Receive a raw buffer of specified length bytes. Using option kPeek
 one can peek at incoming data. Returns number of received bytes.
 Returns -1 in case of error. In case of opt == kOob: -2 means
 EWOULDBLOCK and -3 EINVAL. In case of non-blocking mode (kNoBlock)
 -4 means EWOULDBLOCK. Returns -5 if pipe broken or reset by
 peer (EPIPE || ECONNRESET).
Bool_t RecvStreamerInfos(TMessage* mess)
 Receive a message containing streamer infos. In case the message contains
 streamer infos they are imported, the message will be deleted and the
 method returns kTRUE.
Bool_t RecvProcessIDs(TMessage* mess)
 Receive a message containing process ids. In case the message contains
 process ids they are imported, the message will be deleted and the
 method returns kTRUE.
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.
 For example see TServerSocket ctor.
void SetCompressionAlgorithm(Int_t algorithm = 0)
 See comments for function SetCompressionSettings
void SetCompressionLevel(Int_t level = 1)
 See comments for function SetCompressionSettings
void SetCompressionSettings(Int_t settings = 1)
 Used to specify the compression level and algorithm:
  settings = 100 * algorithm + level

  level = 0, objects written to this file will not be compressed.
  level = 1, minimal compression level but fast.

  level = 9, maximal compression level but slower and might use more memory.
 (For the currently supported algorithms, the maximum level is 9)
 If compress is negative it indicates the compression level is not set yet.

 The enumeration ROOT::ECompressionAlgorithm associates each
 algorithm with a number. There is a utility function to help
 to set the value of the argument. For example,
   ROOT::CompressionSettings(ROOT::kLZMA, 1)
 will build an integer which will set the compression to use
 the LZMA algorithm and compression level 1.  These are defined
 in the header file Compression.h.

 Note that the compression settings may be changed at any time.
 The new compression settings will only apply to branches created
 or attached after the setting is changed and other objects written
 after the setting is changed.
Bool_t Authenticate(const char* user)
 Authenticated the socket with specified user.
TSocket * CreateAuthSocket(const char* url, Int_t size = 0, Int_t tcpwindowsize = -1, TSocket* s = 0, Int_t* err = 0)
 Creates a socket or a parallel socket and authenticates to the
 remote server.

 url: [[proto][p][auth]://][user@]host[:port][/service][?options]

 where  proto = "sockd", "rootd", "proofd"
                indicates the type of remote server;
                if missing "sockd" is assumed ("sockd" indicates
                any remote server session using TServerSocket)
          [p] = for parallel sockets (forced internally for
                rootd; ignored for proofd)
       [auth] = "up", "s", "k", "g", "h", "ug" to force UsrPwd,
                SRP, Krb5, Globus, SSH or UidGid authentication
       [port] = is the remote port number
    [service] = service name used to determine the port
                (for backward compatibility, specification of
                 port as priority)
     options  = "m" or "s", when proto=proofd indicates whether
                we are master or slave (used internally by
                TSlave)

 An already opened connection can be used by passing its socket
 in opensock.

 If 'err' is defined, '*err' on return from a failed call contains an error
 code (see NetErrors.h).

 Example:

   TSocket::CreateAuthSocket("rootds://qwerty@machine.fq.dn:5051")

   creates an authenticated socket to a rootd server running
   on remote machine machine.fq.dn on port 5051; "parallel" sockets
   are forced internally because rootd expects
   parallel sockets; however a simple socket will be created
   in this case because the size is 0 (the default);
   authentication will attempt protocol SRP first.

   TSocket::CreateAuthSocket("pk://qwerty@machine.fq.dn:5052",3)

   creates an authenticated parallel socket of size 3 to a sockd
   server running on remote machine machine.fq.dn on port 5052;
   authentication will attempt protocol Kerberos first.

 NB: may hang if the remote server is not of the correct type;
     at present TSocket has no way to find out the type of the
     remote server automatically

 Returns pointer to an authenticated socket or 0 if creation or
 authentication is unsuccessful.
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)
 Creates a socket or a parallel socket and authenticates to the
 remote server specified in 'url' on remote 'port' as 'user'.

 url: [[proto][p][auth]://]host[/?options]

 where  proto = "sockd", "rootd", "proofd"
                indicates the type of remote server
                if missing "sockd" is assumed ("sockd" indicates
                any remote server session using TServerSocket)
          [p] = for parallel sockets (forced internally for
                rootd)
       [auth] = "up", "s", "k", "g", "h", "ug" to force UsrPwd,
                SRP, Krb5, Globus, SSH or UidGid authentication
    [options] = "m" or "s", when proto=proofd indicates whether
                we are master or slave (used internally by TSlave)

 An already opened connection can be used by passing its socket
 in opensock.

 If 'err' is defined, '*err' on return from a failed call contains an error
 code (see NetErrors.h).

 Example:

   TSocket::CreateAuthSocket("qwerty","rootdps://machine.fq.dn",5051)

   creates an authenticated socket to a rootd server running
   on remote machine machine.fq.dn on port 5051; "parallel"
   sockets are forced internally because rootd expects
   parallel sockets; however a simple socket will be created
   in this case because the size is 0 (the default);
   authentication will attempt protocol SRP first.

   TSocket::CreateAuthSocket("qwerty","pk://machine.fq.dn:5052",3)

   creates an authenticated parallel socket of size 3 to a sockd
   server running on remote machine machine.fq.dn on port 5052;
   authentication will attempt protocol Kerberos first.

 NB: may hang if the remote server is not of the correct type;
     at present TSocket has no way to find out the type of the
     remote server automatically

 Returns pointer to an authenticated socket or 0 if creation or
 authentication is unsuccessful.
Int_t GetClientProtocol()
 Static method returning supported client protocol.
void NetError(const char* where, Int_t error)
 Print error string depending on error code.
ULong64_t GetSocketBytesSent()
 Get total number of bytes sent via all sockets.
ULong64_t GetSocketBytesRecv()
 Get total number of bytes received via all sockets.
Int_t GetCompressionAlgorithm() const
Int_t GetCompressionLevel() const
Int_t GetCompressionSettings() const
friend class TProofServ; // to be able to call SetDescriptor()
TSocket()
{ }
TSocket& operator=(const TSocket& )
Option_t * GetOption() const
{ return TObject::GetOption(); }
virtual ~TSocket()
{ Close(); }
Int_t GetDescriptor() const
{ return fSocket; }
TInetAddress GetInetAddress() const
{ return fAddress; }
Int_t GetPort() const
{ return fAddress.GetPort(); }
const char * GetService() const
{ return fService; }
Int_t GetServType() const
{ return (Int_t)fServType; }
UInt_t GetBytesSent() const
{ return fBytesSent; }
UInt_t GetBytesRecv() const
{ return fBytesRecv; }
Int_t GetRemoteProtocol() const
{ return fRemoteProtocol; }
TSecContext * GetSecContext() const
{ return fSecContext; }
Int_t GetTcpWindowSize() const
{ return fTcpWindowSize; }
TTimeStamp GetLastUsage()
{ R__LOCKGUARD2(fLastUsageMtx); return fLastUsage; }
const char * GetUrl() const
{ return fUrl; }
Bool_t IsAuthenticated() const
{ return fSecContext ? kTRUE : kFALSE; }
Bool_t IsValid() const
{ return fSocket < 0 ? kFALSE : kTRUE; }
Int_t Reconnect()
{ return -1; }
void SetRemoteProtocol(Int_t rproto)
{ fRemoteProtocol = rproto; }
void SetSecContext(TSecContext* ctx)
{ fSecContext = ctx; }
void SetService(const char* service)
{ fService = service; }
void SetServType(Int_t st)
{ fServType = (EServiceType)st; }
void SetUrl(const char* url)
{ fUrl = url; }
void Touch()
{ R__LOCKGUARD2(fLastUsageMtx); fLastUsage.Set(); }