library: libNetx
#include "TXNetFile.h"

TXNetFile


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

class TXNetFile : public TNetFile

Inheritance Chart:
TObject
<-
TNamed
<-
TDirectory
<-
TFile
<-
TNetFile
<-
TXNetFile
    private:
void CreateXClient(const char* url, Option_t* option, Int_t netopt) void FormUrl(char* uut, TString& uu) void Open(Option_t* option) virtual Int_t SysClose(Int_t fd) virtual Int_t SysOpen(const char* pathname, Int_t flags, UInt_t mode) virtual Int_t SysStat(Int_t fd, Long_t* id, Long64_t* size, Long_t* flags, Long_t* modtime) public:
TXNetFile() TXNetFile(const char* url, Option_t* option = "", const char* fTitle = "", Int_t compress = 1, Int_t netopt = -1) virtual ~TXNetFile() static TClass* Class() virtual void Close(Option_t* opt = "") virtual void Flush() virtual TClass* IsA() const virtual Bool_t IsOpen() const virtual Bool_t ReadBuffer(char* buf, Int_t len) virtual Int_t ReOpen(Option_t* mode) virtual void ShowMembers(TMemberInspector& insp, char* parent) Long64_t Size() virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual Bool_t WriteBuffer(const char* buffer, Int_t BufferLength)

Data Members

    private:
XrdClient* fClient Handle to the client object Long64_t fSize File size Bool_t fIsRootd Nature of remote file server static Bool_t fgInitDone Avoid initializing more than once static Bool_t fgRootdBC Control rootd backward compatibility

Class Description

                                                                      
 TXNetFile                                                            
                                                                      
 Authors: Alvise Dorigo, Fabrizio Furano                              
          INFN Padova, 2003                                           
 Interfaced to the posix client: G. Ganis, CERN                       
                                                                      
 TXNetFile is an extension of TNetFile able to deal with new xrootd   
 server. Its new features are:                                        
  - Automatic server kind recognition (xrootd load balancer, xrootd   
    data server, old rootd)                                           
  - Backward compatibility with old rootd server (acts as an old      
    TNetFile)                                                         
  - Fault tolerance for read/write operations (read/write timeouts    
    and retry)                                                        
  - Internal connection timeout (tunable indipendently from the OS    
    one) handled by threads                                           
  - handling of redirections from server                              
  - Single TCP physical channel for multiple TXNetFile's instances    
    inside the same application                                       
    So, each TXNetFile object client must send messages containing    
    its ID (streamid). The server, of course, will respond with       
    messages containing the client's ID, in order to make the client  
    able to recognize its message by matching its streamid with that  
    one contained in the server's response.                           
  - Tunable log verbosity level (0 = nothing, 3 = dump read/write     
    buffers too!)                                                     
  - Many parameters configurable via TEnv facility (see SetParm()     
    methods)                                                          
                                                                      


TXNetFile(const char *url, Option_t *option, const char* ftitle, Int_t compress, Int_t netopt) : TNetFile(url, ftitle, compress, kFALSE)
 Create a TXNetFile object. A TXNetFile object is the same as a TNetFile
 (from which the former derives) except that the protocol is extended to
 support dealing with new xrootd data server or xrootd load balancer
 server.

 The "url" argument must be of the form

   root://server1:port1[,server2:port2,...,serverN:portN]/pathfile,

 Note that this means that multiple servers (>= 1) can be specified in
 the url. The connection will try to connect to the first server:port
 and if that does not succeed, it will try the second one, and so on
 until it finds a server that will respond.

 See the TNetFile documentation for the description of the other arguments.

 The creation consists of internal variable settings (most important is
 the client's domain), creation of a TXUrl array containing all specified
 urls (a single url is serverX:portX/pathfile), trying to connect to the
 servers calling Connect() method, getting a valid access to the remote
 server the client is connected to using GetAccessToSrv() method,
 recognizing the remote server (if an old rootd the TNetFile's Create
 method will be called).

~TXNetFile()
 Destructor.

void FormUrl(char *uut, TString &uus)
 Form url for rootd socket.

void CreateXClient(const char *url, Option_t *option, Int_t netopt)
 The real creation work is done here.

void Open(Option_t *option)
 The real creation work is done here.

Bool_t ReadBuffer(char *buffer, Int_t BufferLength)
 Override TNetFile::ReadBuffer to deal with the xrootd server.
 Returns kTRUE in case of errors.

Bool_t WriteBuffer(const char *buffer, Int_t BufferLength)
 Override TNetFile::WriteBuffer to deal with the xrootd server.
 Returns kTRUE in case of errors.

Bool_t IsOpen() const
 Return kTRUE if the file is open, kFALSE otherwise.

Int_t ReOpen(const Option_t *Mode)
 Re-open the file (see TNetFile::ReOpen() or TFile::ReOpen()
 for more details).

void Close(const Option_t *opt)
 Close the file (see TNetFile::Close() or TFile::Close()
 for more details).

void Flush()
 Flushes un-written data.

Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
 Override TNetFile::SysStat (see parent's method for more details).

Int_t SysClose(Int_t fd)
 Override TNetFile::SysClose (see parent's method for more details).

Int_t SysOpen(const char* pathname, Int_t flags, UInt_t mode)
 Override TNetFile::SysOpen (see parent's method for more details).

Long64_t Size(void)
 Return file size.



Inline Functions


          TXNetFile TXNetFile(const char* url, Option_t* option = "", const char* fTitle = "", Int_t compress = 1, Int_t netopt = -1)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)


Author: Alvise Dorigo, Fabrizio Furano
Last update: root/netx:$Name: $:$Id: TXNetFile.cxx,v 1.14 2005/09/05 10:28:08 rdm Exp $
Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.