library: libNetx #include "TXNetConn.h"

# TXNetConn

class description - source file - inheritance tree (.pdf)

## class TXNetConn

| Inheritance Chart:
`TXNetConn` |

        private:

                                     Bool_t CheckErrorStatus(TXMessage*, Short_t&, char*)
                                       void CheckPort(Int_t& port)
                                     Bool_t CheckResp(ServerResponseHeader* resp, const char* method)
                                 TXMessage* ClientServerCmd(ClientRequest* req, const void* reqMoreData, void** answMoreDataAllocated, void* answMoreData, Bool_t HasToAlloc)
                                     Bool_t DoAuthentication(char* list, int lsiz)
                      TXNetConn::ServerType DoHandShake(Short_t log)
                                     Bool_t DoLogin()
                                    TString GetDomainToMatch(TString hostname)
          TXNetConn::ESrvErrorHandlerRetval HandleServerError(XReqErrorType&, TXMessage*, ClientRequest*)
                                     Bool_t MatchStreamid(ServerResponseHeader* ServerResponse)
                                    TString ParseDomainFromHostname(TString hostname)
                                 TXMessage* ReadPartialAnswer(XReqErrorType&, size_t&, ClientRequest*, Bool_t, void**, TXNetConn::EThreeStateReadHandler&)
                              XReqErrorType WriteToServer(ClientRequest*, ClientRequest*, const void*, Short_t)

        public:

                                TXNetConn()
                                TXNetConn(const TXNetConn&)
                        virtual ~TXNetConn()
                         Bool_t CheckHostDomain(TString hostToCheck, TString allow, TString deny)
                 static TClass* Class()
                        Short_t Connect(TString newHost, Int_t newPort, Int_t netopt)
                           void Disconnect(Bool_t ForcePhysicalDisc)
                         Bool_t GetAccessToSrv()
                        TString GetClientHostDomain() const
                          TUrl* GetLBSUrl() const
                          Int_t GetLogConnID() const
                     XErrorCode GetOpenError() const
                       TSocket* GetRootdSocket() const
          TXNetConn::ServerType GetServerType() const
                  XReqErrorType GoToAnotherServer(TString, Int_t, Int_t)
                virtual TClass* IsA() const
                         Bool_t IsConnected() const
                          Int_t LastBytesRecv()
                          Int_t LastBytesSent()
                          Int_t LastDataBytesRecv()
                          Int_t LastDataBytesSent()
                     TXNetConn& operator=(const TXNetConn&)
                         Bool_t SendGenCommand(ClientRequest* req, const void* reqMoreData, void** answMoreDataAllocated, void* answMoreData, Bool_t HasToAlloc, char* CmdName, ServerResponseHeader* srh = 0)
                           void SetClientHostDomain(const char* src)
                           void SetConnected(Bool_t conn)
                           void SetLogConnID(Short_t logconnid)
                           void SetOpenError(XErrorCode err)
                           void SetRedirHandler(TXAbsNetCommon* rh)
                           void SetServerType(TXNetConn::ServerType type)
                           void SetSID(kXR_char* sid)
                    static void SetTXConnectionMgr(TXConnectionMgr* connmgr)
                           void SetUrl(TUrl thisUrl)
                   virtual void ShowMembers(TMemberInspector& insp, char* parent)
                   virtual void Streamer(TBuffer& b)
                           void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

                          TString fClientHostDomain                Save the client's domain name
                           Bool_t fConnected
                          Short_t fGlobalRedirCnt                  Number of redirections
                           time_t fGlobalRedirLastUpdateTimestamp  Timestamp of last redirection
                            Int_t fLastNetopt
                            TUrl* fLBSUrl                          Needed to save the load balancer url
                          Short_t fLogConnID                       Logical connection ID of the current
                          Short_t fMaxGlobalRedirCnt
                  TXAbsNetCommon* fRedirHandler                    Pointer to a class inheriting from
                          TString fRedirInternalToken              Token returned by the server when
                           Long_t fServerProto                     The server protocol
            TXNetConn::ServerType fServerType                      Server type as returned by doHandShake()
                             TUrl fUrl
                         TSocket* fLastRootdSocket                 rootd case: socket of the last open
                            Int_t fLastRootdProto                  rootd case: remote server protocol
          static TXConnectionMgr* fgConnectionManager              Connection Manager

        public:

                      static const TXNetConn::ServerType kSTError
                      static const TXNetConn::ServerType kSTNone
                      static const TXNetConn::ServerType kSTRootd
                      static const TXNetConn::ServerType kSTBaseXrootd
                      static const TXNetConn::ServerType kSTDataXrootd
          static const TXNetConn::ESrvErrorHandlerRetval kSEHRReturnMsgToCaller
          static const TXNetConn::ESrvErrorHandlerRetval kSEHRBreakLoop
          static const TXNetConn::ESrvErrorHandlerRetval kSEHRContinue
          static const TXNetConn::ESrvErrorHandlerRetval kSEHRReturnNoMsgToCaller
          static const TXNetConn::ESrvErrorHandlerRetval kSEHRRedirLimitReached
          static const TXNetConn::EThreeStateReadHandler kTSRHReturnMex
          static const TXNetConn::EThreeStateReadHandler kTSRHReturnNullMex
          static const TXNetConn::EThreeStateReadHandler kTSRHContinue
                                                   Int_t fLastDataBytesRecv
                                                   Int_t fLastDataBytesSent
                                              XErrorCode fOpenError
                                                 TString fOpenErrorMsg
                                    ServerResponseHeader fLastServerResp

## Class Description

     TXNetConn

     Authors: Alvise Dorigo, Fabrizio Furano
              INFN Padova, 2003

     High level handler of connections to xrootd.
     Instantiated by TXNetFile.

### Inline Functions

                                         void ~TXNetConn()
                                    TXNetConn TXNetConn()
                                       Bool_t CheckHostDomain(TString hostToCheck, TString allow, TString deny)
                                      Short_t Connect(TString newHost, Int_t newPort, Int_t netopt)
                                         void Disconnect(Bool_t ForcePhysicalDisc)
                                       Bool_t GetAccessToSrv()
                                      TString GetClientHostDomain() const
                                        Int_t GetLogConnID() const
                                        TUrl* GetLBSUrl() const
                                   XErrorCode GetOpenError() const
                                     TSocket* GetRootdSocket() const
                                XReqErrorType GoToAnotherServer(TString, Int_t, Int_t)
                                       Bool_t IsConnected() const
                                        Int_t LastBytesRecv()
                                        Int_t LastBytesSent()
                                        Int_t LastDataBytesRecv()
                                        Int_t LastDataBytesSent()
                                       Bool_t SendGenCommand(ClientRequest* req, const void* reqMoreData, void** answMoreDataAllocated, void* answMoreData, Bool_t HasToAlloc, char* CmdName, ServerResponseHeader* srh = 0)
                        TXNetConn::ServerType GetServerType() const
                                         void SetClientHostDomain(const char* src)
                                         void SetConnected(Bool_t conn)
                                         void SetLogConnID(Short_t logconnid)
                                         void SetOpenError(XErrorCode err)
                                         void SetRedirHandler(TXAbsNetCommon* rh)
                                         void SetServerType(TXNetConn::ServerType type)
                                         void SetSID(kXR_char* sid)
                                         void SetUrl(TUrl thisUrl)
                                         void SetTXConnectionMgr(TXConnectionMgr* connmgr)
                                       Bool_t CheckErrorStatus(TXMessage*, Short_t&, char*)
                                         void CheckPort(Int_t& port)
                                       Bool_t CheckResp(ServerResponseHeader* resp, const char* method)
                                   TXMessage* ClientServerCmd(ClientRequest* req, const void* reqMoreData, void** answMoreDataAllocated, void* answMoreData, Bool_t HasToAlloc)
                                       Bool_t DoAuthentication(char* list, int lsiz)
                        TXNetConn::ServerType DoHandShake(Short_t log)
                                       Bool_t DoLogin()
                                      TString GetDomainToMatch(TString hostname)
            TXNetConn::ESrvErrorHandlerRetval HandleServerError(XReqErrorType&, TXMessage*, ClientRequest*)
                                       Bool_t MatchStreamid(ServerResponseHeader* ServerResponse)
                                      TString ParseDomainFromHostname(TString hostname)
                                   TXMessage* ReadPartialAnswer(XReqErrorType&, size_t&, ClientRequest*, Bool_t, void**, TXNetConn::EThreeStateReadHandler&)
                                XReqErrorType WriteToServer(ClientRequest*, ClientRequest*, const void*, Short_t)
                                      TClass* Class()
                                      TClass* IsA() const
                                         void ShowMembers(TMemberInspector& insp, char* parent)
                                         void Streamer(TBuffer& b)
                                         void StreamerNVirtual(TBuffer& b)
                                    TXNetConn TXNetConn(const TXNetConn&)
                                   TXNetConn& operator=(const TXNetConn&)

Author: Alvise Dorigo, Fabrizio Furano
Last update: root/netx:$Name: $:$Id: TXNetConn.h,v 1.5 2005/05/01 10:00:07 rdm Exp $
Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *