xrootd
XrdClientMStream.hh
Go to the documentation of this file.
1#ifndef XRD_CLI_MSTREAM
2#define XRD_CLI_MSTREAM
3/******************************************************************************/
4/* */
5/* X r d C l i e n t M S t r e a m . h h */
6/* */
7/* Author: Fabrizio Furano (INFN Padova, 2006) */
8/* */
9/* This file is part of the XRootD software suite. */
10/* */
11/* XRootD is free software: you can redistribute it and/or modify it under */
12/* the terms of the GNU Lesser General Public License as published by the */
13/* Free Software Foundation, either version 3 of the License, or (at your */
14/* option) any later version. */
15/* */
16/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
17/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
18/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
19/* License for more details. */
20/* */
21/* You should have received a copy of the GNU Lesser General Public License */
22/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
23/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
24/* */
25/* The copyright holder's institutional names and contributor's names may not */
26/* be used to endorse or promote products derived from this software without */
27/* specific prior written permission of the institution or contributor. */
28/******************************************************************************/
29
31// //
32// Helper code for XrdClient to handle multistream behavior //
33// //
35
37
39public:
40
41 // Compute the parameters to split blocks
43 int &spltsize, int &reqsperstream,
44 kXR_int32 len);
45
46 // Establish all the parallel streams, stop
47 // adding streams at the first creation refusal/failure
49
50 // Add a parallel stream to the pool used by the given client inst
51 static int AddParallelStream(XrdClientConn *cliconn, int port, int windowsz, int tempid);
52
53 // Remove a parallel stream to the pool used by the given client inst
54 static int RemoveParallelStream(XrdClientConn *cliconn, int substream);
55
56 // Binds the pending temporary parallel stream to the current session
57 // Returns into newid the substreamid assigned by the server
58 static bool BindPendingStream(XrdClientConn *cliconn, int substreamid, int &newid);
59
60 struct ReadChunk {
64 };
65
66
67 // This splits a long requests into many smaller requests, to be sent in parallel
68 // through multiple streams
69 // Returns false if the chunk is not worth splitting
70 static bool SplitReadRequest(XrdClientConn *cliconn, kXR_int64 offset, kXR_int32 len,
72
73
74};
75#endif
long long kXR_int64
Definition: XPtypes.hh:98
int kXR_int32
Definition: XPtypes.hh:89
Definition: XrdClientConn.hh:54
Definition: XrdClientMStream.hh:38
static int EstablishParallelStreams(XrdClientConn *cliconn)
static bool SplitReadRequest(XrdClientConn *cliconn, kXR_int64 offset, kXR_int32 len, XrdClientVector< ReadChunk > &reqlists)
static int AddParallelStream(XrdClientConn *cliconn, int port, int windowsz, int tempid)
static void GetGoodSplitParameters(XrdClientConn *cliconn, int &spltsize, int &reqsperstream, kXR_int32 len)
static int RemoveParallelStream(XrdClientConn *cliconn, int substream)
static bool BindPendingStream(XrdClientConn *cliconn, int substreamid, int &newid)
Definition: XrdClientVector.hh:49
Definition: XrdClientMStream.hh:60
kXR_int32 len
Definition: XrdClientMStream.hh:62
int streamtosend
Definition: XrdClientMStream.hh:63
kXR_int64 offset
Definition: XrdClientMStream.hh:61