Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
XrdProofdResponse.h
Go to the documentation of this file.
1// @(#)root/proofd:$Id$
2// Author: G. Ganis June 2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_XrdProofdResponse
13#define ROOT_XrdProofdResponse
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// XrdProofdResponse //
18// //
19// Authors: G. Ganis, CERN, 2005 //
20// //
21// Utility class to handle replies to clients. //
22// //
23//////////////////////////////////////////////////////////////////////////
24
25#include <string.h>
26#include <unistd.h>
27#include <sys/uio.h>
28
29#include "XpdSysPthread.h"
30
31#include "XrdOuc/XrdOucString.hh"
32#include "XProofProtocol.h"
33
34class XrdLink;
35
37{
38 public:
40 virtual ~XrdProofdResponse() {}
41
42 inline const char *STRID() { return (const char *)fTrsid;}
43 inline const char *TraceID() const { return fTraceID.c_str(); }
44
45 inline XrdLink *Link() const { return fLink; }
46
47 int LinkSend(const char *buff, int len, XrdOucString &e);
48 int LinkSend(const struct iovec *iov,
49 int iocnt, int len, XrdOucString &e);
50
51 int Send(void);
52 int Send(const char *msg);
53 int Send(void *data, int dlen);
54 int Send(XResponseType rcode);
55 int Send(XResponseType rcode, void *data, int dlen);
56 int Send(XErrorCode ecode, const char *msg);
57 int Send(XPErrorCode ecode, const char *msg);
58 int Send(XResponseType rcode, int info, char *data = 0);
59 int Send(XResponseType rcode, XProofActionCode acode, int info);
60 int Send(XResponseType rcode,
61 XProofActionCode acode, void *data, int dlen);
62 int Send(XResponseType rcode, XProofActionCode acode,
63 kXR_int32 sid, void *data, int dlen);
64
65 int SendI(kXR_int32 int1, void *data = 0, int dlen = 0);
66 int SendI(kXR_int32 int1, kXR_int32 int2, void *data = 0, int dlen = 0);
67 int SendI(kXR_int32 int1, kXR_int16 int2, kXR_int16 int3,
68 void *data = 0, int dlen = 0);
69
70 void Set(XrdLink *l);
71 inline void SetTag(const char *tag) { fTag = tag; }
72 void SetTraceID();
73 void Set(unsigned char *stream);
74 void Set(unsigned short streamid);
75 void Set(ServerResponseHeader *resp);
76
77 void GetSID(unsigned short &sid);
78 void SetTrsid();
79
81 fLink = 0; *fTrsid = '\0'; fSID = 0;
82 fResp.dlen = 0; fResp.status = 0;
83 fResp.streamid[0] = 0; fResp.streamid[1] = 0; }
84
85 // To protect from concurrent use
87
88 private:
89
90 ServerResponseHeader fResp;
91 XrdLink *fLink;
92 char fTrsid[8]; // sizeof() does not work here
93
94 unsigned short fSID;
95
96 XrdOucString fTraceID;
97 XrdOucString fTag;
98};
99#endif
#define e(i)
Definition RSha256.hxx:103
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
XPErrorCode
XProofActionCode
#define XrdSysMutexHelper
Definition XrdSysToOuc.h:17
#define XrdSysRecMutex
Definition XrdSysToOuc.h:18
void Set(XrdLink *l)
Set the link to be used by this response.
XrdLink * Link() const
void GetSID(unsigned short &sid)
Get stream ID (to be able to restore it later.
void SetTag(const char *tag)
int Send(void)
Auxilliary Send method.
int LinkSend(const char *buff, int len, XrdOucString &e)
Method actually sending the buffer(s) over the link.
const char * TraceID() const
const char * STRID()
unsigned short fSID
int SendI(kXR_int32 int1, void *data=0, int dlen=0)
Auxilliary Send method.
ServerResponseHeader fResp
void SetTrsid()
Auxilliary Set method.
XrdSysRecMutex fMutex
void SetTraceID()
Auxilliary set method.
TLine l
Definition textangle.C:4