18 #ifndef INCLUDE_RCF_WIN32NAMEDPIPESERVERTRANSPORT_HPP 19 #define INCLUDE_RCF_WIN32NAMEDPIPESERVERTRANSPORT_HPP 21 #include <RCF/AsioFwd.hpp> 22 #include <RCF/AsioServerTransport.hpp> 23 #include <RCF/Export.hpp> 28 class Win32NamedPipeServerTransport;
32 class RCF_EXPORT Win32NamedPipeNetworkSession :
public AsioNetworkSession
35 Win32NamedPipeNetworkSession(
36 Win32NamedPipeServerTransport & transport,
37 AsioIoService & ioService);
39 ~Win32NamedPipeNetworkSession();
41 const RemoteAddress & implGetRemoteAddress();
43 void implRead(
char * buffer, std::size_t bufferLen);
45 void implWrite(
const std::vector<ByteBuffer> & buffers);
47 void implWrite(AsioNetworkSession &toBeNotified,
const char * buffer, std::size_t bufferLen);
53 bool implIsConnected();
59 void implTransferNativeFrom(ClientTransport & clientTransport);
61 static void closeSocket(AsioPipeHandlePtr socketPtr);
63 HANDLE getNativeHandle();
66 AsioPipeHandlePtr mSocketPtr;
67 tstring mRemotePipeName;
68 NoRemoteAddress mRemoteAddress;
70 friend class Win32NamedPipeServerTransport;
71 friend class Win32NamedPipeImpersonator;
74 class RCF_EXPORT Win32NamedPipeServerTransport :
75 public AsioServerTransport
79 Win32NamedPipeServerTransport(
const tstring & pipeName);
80 ~Win32NamedPipeServerTransport();
86 AsioNetworkSessionPtr implCreateNetworkSession();
89 const Endpoint &endpoint);
91 tstring getPipeName()
const;
93 void onServerStart(RcfServer & server);
94 void onServerStop(RcfServer & server);
96 void setSecurityAttributes(LPSECURITY_ATTRIBUTES pSec);
100 friend class Win32NamedPipeNetworkSession;
103 HANDLE mPipeNameLock;
105 LPSECURITY_ATTRIBUTES mpSec;
123 void revertToSelf()
const;
127 Win32NamedPipeNetworkSession & mPipeSession;
130 class RCF_EXPORT NullDacl
134 SECURITY_ATTRIBUTES mSa;
135 SECURITY_DESCRIPTOR mSd;
140 #endif // ! INCLUDE_RCF_WIN32NAMEDPIPESERVERTRANSPORT_HPP Allows the server side of a Win32 named pipe to impersonate the client.
Definition: Win32NamedPipeServerTransport.hpp:109
Represents a server side session, associated with a client connection.
Definition: RcfSession.hpp:64
std::unique_ptr< ClientTransport > ClientTransportUniquePtr
Unique pointer wrapper for RCF::ClientTransport.
Definition: RcfFwd.hpp:43
Definition: AmiIoHandler.hpp:23
TransportType
Describes the transport types used by a RCF connection.
Definition: Enums.hpp:33
std::shared_ptr< ServerTransport > ServerTransportPtr
Unique pointer wrapper for RCF::ServerTransport.
Definition: RcfFwd.hpp:46