xrootd
XrdClientMStream.hh
Go to the documentation of this file.
1 
2 // //
3 // XrdClientMStream //
4 // //
5 // Author: Fabrizio Furano (INFN Padova, 2006) //
6 // //
7 // Helper code for XrdClient to handle multistream behavior //
8 // //
10 
11 // $Id$
12 
13 
14 #ifndef XRD_CLI_MSTREAM
15 #define XRD_CLI_MSTREAM
16 
18 
20 
21 
22 
23 
24 
25 public:
26 
27  // Compute the parameters to split blocks
28  static void GetGoodSplitParameters(XrdClientConn *cliconn,
29  int &spltsize, int &reqsperstream,
30  kXR_int32 len);
31 
32  // Establish all the parallel streams, stop
33  // adding streams at the first creation refusal/failure
34  static int EstablishParallelStreams(XrdClientConn *cliconn);
35 
36  // Add a parallel stream to the pool used by the given client inst
37  static int AddParallelStream(XrdClientConn *cliconn, int port, int windowsz, int tempid);
38 
39  // Remove a parallel stream to the pool used by the given client inst
40  static int RemoveParallelStream(XrdClientConn *cliconn, int substream);
41 
42  // Binds the pending temporary parallel stream to the current session
43  // Returns into newid the substreamid assigned by the server
44  static bool BindPendingStream(XrdClientConn *cliconn, int substreamid, int &newid);
45 
46  struct ReadChunk {
50  };
51 
52 
53  // This splits a long requests into many smaller requests, to be sent in parallel
54  // through multiple streams
55  // Returns false if the chunk is not worth splitting
56  static bool SplitReadRequest(XrdClientConn *cliconn, kXR_int64 offset, kXR_int32 len,
57  XrdClientVector<ReadChunk> &reqlists);
58 
59 
60 };
61 
62 
63 
64 
65 
66 
67 #endif