19 #ifndef INCLUDE_RCF_UNIXLOCALSERVERTRANSPORT_HPP 20 #define INCLUDE_RCF_UNIXLOCALSERVERTRANSPORT_HPP 22 #include <RCF/Asio.hpp> 25 #error Unix domain sockets not supported on Windows. 28 #ifndef RCF_HAS_LOCAL_SOCKETS 29 #error Unix domain sockets not supported by this version of Boost.Asio. 32 #include <RCF/AsioServerTransport.hpp> 33 #include <RCF/Export.hpp> 37 using ASIO_NS::local::stream_protocol;
38 typedef stream_protocol::socket UnixLocalSocket;
39 typedef std::shared_ptr<UnixLocalSocket> UnixLocalSocketPtr;
41 class UnixLocalServerTransport;
43 class RCF_EXPORT UnixLocalNetworkSession :
public AsioNetworkSession
46 UnixLocalNetworkSession(
47 UnixLocalServerTransport & transport,
48 AsioIoService & ioService);
50 ~UnixLocalNetworkSession();
52 const RemoteAddress & implGetRemoteAddress();
54 void implRead(
char * buffer, std::size_t bufferLen);
56 void implWrite(
const std::vector<ByteBuffer> & buffers);
62 bool implIsConnected();
66 void implCloseAfterWrite();
70 void implTransferNativeFrom(ClientTransport & clientTransport);
72 int getNativeHandle();
75 UnixLocalSocketPtr mSocketPtr;
76 std::string mRemoteFileName;
77 NoRemoteAddress mRemoteAddress;
80 class RCF_EXPORT UnixLocalServerTransport :
81 public AsioServerTransport
85 UnixLocalServerTransport(
const std::string & fileName);
91 AsioNetworkSessionPtr implCreateNetworkSession();
96 const Endpoint &endpoint);
98 std::string getPipeName()
const;
100 void onServerStart(RcfServer & server);
101 void onServerStop(RcfServer & server);
105 const std::string mFileName;
110 #endif // ! INCLUDE_RCF_UNIXLOCALSERVERTRANSPORT_HPP std::unique_ptr< ClientTransport > ClientTransportUniquePtr
Unique pointer wrapper for RCF::ClientTransport.
Definition: RcfFwd.hpp:44
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:47