File indexing completed on 2025-01-18 10:12:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TServerSocket
0013 #define ROOT_TServerSocket
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #include "TSocket.h"
0029 #include <string>
0030
0031 class TSeqCollection;
0032
0033 typedef Int_t (*SrvAuth_t)(TSocket *sock, const char *, const char *,
0034 std::string&, Int_t &, Int_t &, std::string &,
0035 TSeqCollection *);
0036 typedef Int_t (*SrvClup_t)(TSeqCollection *);
0037
0038
0039 const UChar_t kSrvAuth = 0x1;
0040 const UChar_t kSrvNoAuth = (kSrvAuth<<4);
0041
0042 class TServerSocket : public TSocket {
0043
0044 private:
0045 TSeqCollection *fSecContexts;
0046 static SrvAuth_t fgSrvAuthHook;
0047 static SrvClup_t fgSrvAuthClupHook;
0048 static UChar_t fgAcceptOpt;
0049
0050 TServerSocket() : fSecContexts(nullptr) {}
0051 TServerSocket(const TServerSocket &);
0052 void operator=(const TServerSocket &);
0053 Bool_t Authenticate(TSocket *);
0054
0055 public:
0056 enum { kDefaultBacklog = 10 };
0057
0058 TServerSocket(Int_t port, Bool_t reuse = kFALSE, Int_t backlog = kDefaultBacklog,
0059 Int_t tcpwindowsize = -1);
0060 TServerSocket(const char *service, Bool_t reuse = kFALSE,
0061 Int_t backlog = kDefaultBacklog, Int_t tcpwindowsize = -1);
0062 virtual ~TServerSocket();
0063
0064 virtual TSocket *Accept(UChar_t Opt = 0);
0065 TInetAddress GetLocalInetAddress() override;
0066 Int_t GetLocalPort() override;
0067
0068 Int_t Send(const TMessage &) override
0069 { MayNotUse("Send(const TMessage &)"); return 0; }
0070 Int_t Send(Int_t) override
0071 { MayNotUse("Send(Int_t)"); return 0; }
0072 Int_t Send(Int_t, Int_t) override
0073 { MayNotUse("Send(Int_t, Int_t)"); return 0; }
0074 Int_t Send(const char *, Int_t = kMESS_STRING) override
0075 { MayNotUse("Send(const char *, Int_t)"); return 0; }
0076 Int_t SendObject(const TObject *, Int_t = kMESS_OBJECT) override
0077 { MayNotUse("SendObject(const TObject *, Int_t)"); return 0; }
0078 Int_t SendRaw(const void *, Int_t, ESendRecvOptions = kDefault) override
0079 { MayNotUse("SendRaw(const void *, Int_t, ESendRecvOptions)"); return 0; }
0080 Int_t Recv(TMessage *&) override
0081 { MayNotUse("Recv(TMessage *&)"); return 0; }
0082 Int_t Recv(Int_t &, Int_t &) override
0083 { MayNotUse("Recv(Int_t &, Int_t &)"); return 0; }
0084 Int_t Recv(char *, Int_t) override
0085 { MayNotUse("Recv(char *, Int_t)"); return 0; }
0086 Int_t Recv(char *, Int_t, Int_t &) override
0087 { MayNotUse("Recv(char *, Int_t, Int_t &)"); return 0; }
0088 Int_t RecvRaw(void *, Int_t, ESendRecvOptions = kDefault) override
0089 { MayNotUse("RecvRaw(void *, Int_t, ESendRecvOptions)"); return 0; }
0090
0091 static UChar_t GetAcceptOptions();
0092 static void SetAcceptOptions(UChar_t Opt);
0093 static void ShowAcceptOptions();
0094
0095 ClassDefOverride(TServerSocket, 0);
0096 };
0097
0098 #endif