File indexing completed on 2026-04-17 08:35:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef _THRIFT_TRANSPORT_TSERVERWINPIPES_H_
0021 #define _THRIFT_TRANSPORT_TSERVERWINPIPES_H_ 1
0022
0023 #include <memory>
0024 #include <thrift/transport/TServerTransport.h>
0025 #ifndef _WIN32
0026 #include <thrift/transport/TServerSocket.h>
0027 #endif
0028
0029 #define TPIPE_SERVER_MAX_CONNS_DEFAULT PIPE_UNLIMITED_INSTANCES
0030
0031
0032
0033
0034 const std::string DEFAULT_PIPE_SECURITY{"D:(A;;FA;;;WD)"};
0035
0036 namespace apache {
0037 namespace thrift {
0038 namespace transport {
0039
0040
0041
0042
0043
0044
0045
0046 #ifdef _WIN32
0047 class TPipeServerImpl;
0048 class TPipe;
0049
0050 class TPipeServer : public TServerTransport {
0051 public:
0052
0053
0054 TPipeServer(const std::string& pipename, uint32_t bufsize);
0055 TPipeServer(const std::string& pipename, uint32_t bufsize, uint32_t maxconnections);
0056 TPipeServer(const std::string& pipename,
0057 uint32_t bufsize,
0058 uint32_t maxconnections,
0059 const std::string& securityDescriptor);
0060 TPipeServer(const std::string& pipename);
0061
0062 TPipeServer(int bufsize);
0063 TPipeServer();
0064
0065
0066 virtual ~TPipeServer();
0067
0068 bool isOpen() const override;
0069
0070
0071 void interrupt() override;
0072 void close() override;
0073 void listen() override;
0074
0075
0076 std::string getPipename();
0077 void setPipename(const std::string& pipename);
0078 int getBufferSize();
0079 void setBufferSize(int bufsize);
0080 HANDLE getPipeHandle();
0081 HANDLE getWrtPipeHandle();
0082 HANDLE getClientRdPipeHandle();
0083 HANDLE getClientWrtPipeHandle();
0084 bool getAnonymous();
0085 void setAnonymous(bool anon);
0086 void setMaxConnections(uint32_t maxconnections);
0087 void setSecurityDescriptor(const std::string& securityDescriptor);
0088
0089
0090
0091 HANDLE getNativeWaitHandle();
0092
0093 protected:
0094 virtual std::shared_ptr<TTransport> acceptImpl();
0095
0096 private:
0097 std::shared_ptr<TPipeServerImpl> impl_;
0098
0099 std::string pipename_;
0100 std::string securityDescriptor_;
0101 uint32_t bufsize_;
0102 uint32_t maxconns_;
0103 bool isAnonymous_;
0104 };
0105 #else
0106
0107 typedef TServerSocket TPipeServer;
0108 #endif
0109 }
0110 }
0111 }
0112
0113 #endif