#include <XrdXrootdTransSend.hh>
|
| XrdXrootdTransSend (XrdLink *lP, kXR_char *sid, kXR_unt16 req, long long offset, int dlen, int fdnum) |
|
| XrdXrootdTransSend (XrdLink *lP, kXR_char *sid, kXR_unt16 req, XrdOucSFVec *sfvec, int sfvnum, int dlen) |
|
| ~XrdXrootdTransSend () |
|
int | Send (const struct iovec *headP, int headN, const struct iovec *tailP, int tailN) |
|
| Context (XrdLink *lP, kXR_char *sid, kXR_unt16 req) |
| Constructor and Destructor. More...
|
|
virtual | ~Context () |
|
Definition at line 40 of file XrdXrootdTransSend.hh.
◆ XrdXrootdTransSend() [1/2]
XrdXrootdTransSend::XrdXrootdTransSend |
( |
XrdLink * |
lP, |
|
|
kXR_char * |
sid, |
|
|
kXR_unt16 |
req, |
|
|
long long |
offset, |
|
|
int |
dlen, |
|
|
int |
fdnum |
|
) |
| |
|
inline |
Definition at line 52 of file XrdXrootdTransSend.hh.
55 sfOff(offset), sfLen(dlen), sfFD(fdnum) {}
Context(XrdLink *lP, kXR_char *sid, kXR_unt16 req)
Constructor and Destructor.
◆ XrdXrootdTransSend() [2/2]
◆ ~XrdXrootdTransSend()
XrdXrootdTransSend::~XrdXrootdTransSend |
( |
| ) |
|
|
inline |
◆ Send()
int XrdXrootdTransSend::Send |
( |
const struct iovec * |
headP, |
|
|
int |
headN, |
|
|
const struct iovec * |
tailP, |
|
|
int |
tailN |
|
) |
| |
|
virtual |
Complete a File() callback.
The Send() method must be called after the File() callback is invoked to complete data transmission using sendfile(). If Send() is not called the pending sendfile() call is not made and no data is sent to the client.
- Parameters
-
headP | a pointer to the iovec structure containing the data that must be sent before the sendfile() data. If there is none, the pointer can be null. |
headN | the number of elements in the headP iovec structure array. |
tailP | a pointer to the iovec structure containing the data that must be sent after the sendfile() data. If there is none, the pointer can be null. |
tailN | the number of elements in the tailP iovec structure array. |
- Returns
- < 0 transmission error has occurred. This can be due to either connection failure or data source error (i.e. I/O error). = 0 data has been successfully sent. > 0 the supplied context was not generated by a valid File() callback. No data has been sent.
- Parameters
-
headP | pointer to leading data array |
headN | array count |
tailP | pointer to trailing data array |
tailN | array count |
Reimplemented from XrdXrootd::Bridge::Context.
Definition at line 38 of file XrdXrootdTransSend.cc.
42 int i, k = 0, numV = headN + tailN + 1;
51 if (headP)
for (i = 0; i < headN; i++, k++)
52 {sfVec[k].buffer = (
char *)headP[i].iov_base;
53 sfVec[k].
sendsz = headP[i].iov_len;
60 {sfVec[k].offset = sfOff;
62 sfVec[k].
fdnum = sfFD;
65 for (i = 1; i < -sfFD; i++)
66 {sfVec[k ].offset = sfVP[i].offset;
67 sfVec[k ].
sendsz = sfVP[i].sendsz;
68 sfVec[k++].
fdnum = sfVP[i].fdnum;
74 if (tailP)
for (i = 0; i < tailN; i++, k++)
75 {sfVec[k].buffer = (
char *)tailP[i].iov_base;
76 sfVec[k].
sendsz = tailP[i].iov_len;
87 return (k < 0 ? -1 : 0);
int Send(const char *buff, int blen)
XrdLink * linkP
-> associated session link object (i.e. connection)
int fdnum
File descriptor for data.
int sendsz
Length of data at offset.
References XrdOucSFVec::fdnum, XrdXrootd::Bridge::Context::linkP, XrdLink::Send(), and XrdOucSFVec::sendsz.
The documentation for this class was generated from the following files: