xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdClient
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
36
#include "
XrdClient/XrdClientConn.hh
"
37
38
class
XrdClientMStream
{
39
public
:
40
41
// Compute the parameters to split blocks
42
static
void
GetGoodSplitParameters
(
XrdClientConn
*cliconn,
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
48
static
int
EstablishParallelStreams
(
XrdClientConn
*cliconn);
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
{
61
kXR_int64
offset
;
62
kXR_int32
len
;
63
int
streamtosend
;
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,
71
XrdClientVector<ReadChunk>
&reqlists);
72
73
74
};
75
#endif
Generated by
1.8.3.1