19 #ifndef INCLUDE_RCF_WIN32NAMEDPIPESERVERTRANSPORT_HPP 20 #define INCLUDE_RCF_WIN32NAMEDPIPESERVERTRANSPORT_HPP 22 #include <RCF/AsioFwd.hpp> 23 #include <RCF/AsioServerTransport.hpp> 24 #include <RCF/Export.hpp> 29 class Win32NamedPipeServerTransport;
33 class RCF_EXPORT Win32NamedPipeNetworkSession :
public AsioNetworkSession
36 Win32NamedPipeNetworkSession(
37 Win32NamedPipeServerTransport & transport,
38 AsioIoService & ioService);
40 ~Win32NamedPipeNetworkSession();
42 const RemoteAddress & implGetRemoteAddress();
44 void implRead(
char * buffer, std::size_t bufferLen);
46 void implWrite(
const std::vector<ByteBuffer> & buffers);
48 void implWrite(AsioNetworkSession &toBeNotified,
const char * buffer, std::size_t bufferLen);
54 bool implIsConnected();
60 void implTransferNativeFrom(ClientTransport & clientTransport);
62 static void closeSocket(AsioPipeHandlePtr socketPtr);
64 HANDLE getNativeHandle();
67 AsioPipeHandlePtr mSocketPtr;
68 tstring mRemotePipeName;
69 NoRemoteAddress mRemoteAddress;
71 friend class Win32NamedPipeServerTransport;
72 friend class Win32NamedPipeImpersonator;
75 class RCF_EXPORT Win32NamedPipeServerTransport :
76 public AsioServerTransport
80 Win32NamedPipeServerTransport(
const tstring & pipeName);
81 ~Win32NamedPipeServerTransport();
87 AsioNetworkSessionPtr implCreateNetworkSession();
90 const Endpoint &endpoint);
92 tstring getPipeName()
const;
94 void onServerStart(RcfServer & server);
95 void onServerStop(RcfServer & server);
97 void setSecurityAttributes(LPSECURITY_ATTRIBUTES pSec);
101 friend class Win32NamedPipeNetworkSession;
104 HANDLE mPipeNameLock;
106 LPSECURITY_ATTRIBUTES mpSec;
124 void revertToSelf()
const;
128 Win32NamedPipeNetworkSession & mPipeSession;
131 class RCF_EXPORT NullDacl
135 SECURITY_ATTRIBUTES mSa;
136 SECURITY_DESCRIPTOR mSd;
141 #endif // ! INCLUDE_RCF_WIN32NAMEDPIPESERVERTRANSPORT_HPP Allows the server side of a Win32 named pipe to impersonate the client.
Definition: Win32NamedPipeServerTransport.hpp:110
Represents a server side session, associated with a client connection.
Definition: RcfSession.hpp:67
std::unique_ptr< ClientTransport > ClientTransportUniquePtr
Unique pointer wrapper for RCF::ClientTransport.
Definition: RcfFwd.hpp:43
Definition: AmiIoHandler.hpp:24
TransportType
Describes the transport types used by a RCF connection.
Definition: Enums.hpp:34
std::shared_ptr< ServerTransport > ServerTransportPtr
Unique pointer wrapper for RCF::ServerTransport.
Definition: RcfFwd.hpp:46