Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TServerSocket.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/net:$Id$
0002 // Author: Fons Rademakers   18/12/96
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TServerSocket
0013 #define ROOT_TServerSocket
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TServerSocket                                                        //
0019 //                                                                      //
0020 // This class implements server sockets. A server socket waits for      //
0021 // requests to come in over the network. It performs some operation     //
0022 // based on that request and then possibly returns a full duplex socket //
0023 // to the requester. The actual work is done via the TSystem class      //
0024 // (either TUnixSystem or TWinNTSystem).                                //
0025 //                                                                      //
0026 //////////////////////////////////////////////////////////////////////////
0027 
0028 #include "TSocket.h"
0029 #include <string>
0030 
0031 class TSeqCollection;
0032 
0033 namespace ROOT::Deprecated {
0034 
0035 typedef Int_t (*SrvAuth_t)(TSocket *sock, const char *, const char *,
0036                            std::string&, Int_t &, Int_t &, std::string &,
0037                            TSeqCollection *);
0038 typedef Int_t (*SrvClup_t)(TSeqCollection *);
0039 
0040 // These mask are globally available to manipulate the option to Accept
0041 const UChar_t kSrvAuth   = 0x1;            // Require client authentication
0042 const UChar_t kSrvNoAuth = (kSrvAuth<<4);  // Force no client authentication
0043 
0044 } // namespace ROOT::Deprecated
0045 
0046 using SrvAuth_t R__DEPRECATED(6, 42, "Socket authentication is deprecated") = ROOT::Deprecated::SrvAuth_t;
0047 using SrvClup_t R__DEPRECATED(6, 42, "Socket authentication is deprecated") = ROOT::Deprecated::SrvClup_t;
0048 const UChar_t kSrvAuth R__DEPRECATED(6, 42, "Socket authentication is deprecated") = ROOT::Deprecated::kSrvAuth;
0049 const UChar_t kSrvNoAuth R__DEPRECATED(6, 42, "Socket authentication is deprecated") = ROOT::Deprecated::kSrvNoAuth;
0050 
0051 class TServerSocket : public TSocket {
0052 
0053 private:
0054    TSeqCollection  *fSecContexts; // List of TSecContext with cleanup info
0055    static ROOT::Deprecated::SrvAuth_t fgSrvAuthHook;
0056    static ROOT::Deprecated::SrvClup_t fgSrvAuthClupHook;
0057    static UChar_t fgAcceptOpt;     // Default accept options (DEPRECATED)
0058 
0059    TServerSocket() : fSecContexts(nullptr) {}
0060    TServerSocket(const TServerSocket &);
0061    void operator=(const TServerSocket &);
0062    Bool_t Authenticate(TSocket *);
0063 
0064 public:
0065    enum { kDefaultBacklog = 10 };
0066 
0067    TServerSocket(Int_t port, Bool_t reuse = kFALSE, Int_t backlog = kDefaultBacklog, Int_t tcpwindowsize = -1,
0068                  ESocketBindOption socketBindOption = ESocketBindOption::kInaddrAny);
0069    TServerSocket(const char *service, Bool_t reuse = kFALSE,
0070                  Int_t backlog = kDefaultBacklog, Int_t tcpwindowsize = -1);
0071    virtual ~TServerSocket();
0072 
0073    virtual TSocket      *Accept(UChar_t Opt = 0);
0074    TInetAddress  GetLocalInetAddress() override;
0075    Int_t         GetLocalPort() override;
0076 
0077    Int_t         Send(const TMessage &) override
0078                     { MayNotUse("Send(const TMessage &)"); return 0; }
0079    Int_t         Send(Int_t) override
0080                     { MayNotUse("Send(Int_t)"); return 0; }
0081    Int_t         Send(Int_t, Int_t) override
0082                     { MayNotUse("Send(Int_t, Int_t)"); return 0; }
0083    Int_t         Send(const char *, Int_t = kMESS_STRING) override
0084                     { MayNotUse("Send(const char *, Int_t)"); return 0; }
0085    Int_t         SendObject(const TObject *, Int_t = kMESS_OBJECT) override
0086                     { MayNotUse("SendObject(const TObject *, Int_t)"); return 0; }
0087    Int_t         SendRaw(const void *, Int_t, ESendRecvOptions = kDefault) override
0088                     { MayNotUse("SendRaw(const void *, Int_t, ESendRecvOptions)"); return 0; }
0089    Int_t         Recv(TMessage *&) override
0090                     { MayNotUse("Recv(TMessage *&)"); return 0; }
0091    Int_t         Recv(Int_t &, Int_t &) override
0092                     { MayNotUse("Recv(Int_t &, Int_t &)"); return 0; }
0093    Int_t         Recv(char *, Int_t) override
0094                     { MayNotUse("Recv(char *, Int_t)"); return 0; }
0095    Int_t         Recv(char *, Int_t, Int_t &) override
0096                     { MayNotUse("Recv(char *, Int_t, Int_t &)"); return 0; }
0097    Int_t         RecvRaw(void *, Int_t, ESendRecvOptions = kDefault) override
0098                     { MayNotUse("RecvRaw(void *, Int_t, ESendRecvOptions)"); return 0; }
0099 
0100    static UChar_t     GetAcceptOptions() R__DEPRECATED(6, 42, "Socket authentication is deprecated");
0101    static void        SetAcceptOptions(UChar_t Opt) R__DEPRECATED(6, 42, "Socket authentication is deprecated");
0102    static void        ShowAcceptOptions() R__DEPRECATED(6, 42, "Socket authentication is deprecated");
0103 
0104    ClassDefOverride(TServerSocket, 0);  //This class implements server sockets
0105 };
0106 
0107 #endif