18 #ifndef INCLUDE_RCF_UNIXLOCALSERVERTRANSPORT_HPP 19 #define INCLUDE_RCF_UNIXLOCALSERVERTRANSPORT_HPP 21 #include <RCF/Asio.hpp> 24 #error Unix domain sockets not supported on Windows. 27 #ifndef RCF_HAS_LOCAL_SOCKETS 28 #error Unix domain sockets not supported by this version of Boost.Asio. 31 #include <RCF/AsioServerTransport.hpp> 32 #include <RCF/Export.hpp> 36 using ASIO_NS::local::stream_protocol;
37 typedef stream_protocol::socket UnixLocalSocket;
38 typedef std::shared_ptr<UnixLocalSocket> UnixLocalSocketPtr;
40 class UnixLocalServerTransport;
42 class RCF_EXPORT UnixLocalNetworkSession :
public AsioNetworkSession
45 UnixLocalNetworkSession(
46 UnixLocalServerTransport & transport,
47 AsioIoService & ioService);
49 ~UnixLocalNetworkSession();
51 const RemoteAddress & implGetRemoteAddress();
53 void implRead(
char * buffer, std::size_t bufferLen);
55 void implWrite(
const std::vector<ByteBuffer> & buffers);
61 bool implIsConnected();
65 void implCloseAfterWrite();
69 void implTransferNativeFrom(ClientTransport & clientTransport);
71 int getNativeHandle();
74 UnixLocalSocketPtr mSocketPtr;
75 std::string mRemoteFileName;
76 NoRemoteAddress mRemoteAddress;
79 class RCF_EXPORT UnixLocalServerTransport :
80 public AsioServerTransport
84 UnixLocalServerTransport(
const std::string & fileName);
90 AsioNetworkSessionPtr implCreateNetworkSession();
95 const Endpoint &endpoint);
97 std::string getPipeName()
const;
99 void onServerStart(RcfServer & server);
100 void onServerStop(RcfServer & server);
104 const std::string mFileName;
109 #endif // ! INCLUDE_RCF_UNIXLOCALSERVERTRANSPORT_HPP 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