19 #ifndef INCLUDE_RCF_TCPSERVERTRANSPORT_HPP
20 #define INCLUDE_RCF_TCPSERVERTRANSPORT_HPP
22 #include <RCF/AsioServerTransport.hpp>
24 #include <RCF/Asio.hpp>
28 class TcpServerTransport;
30 class RCF_EXPORT TcpNetworkSession :
public AsioNetworkSession
35 TcpServerTransport &transport,
36 AsioIoService & ioService);
38 const RemoteAddress & implGetRemoteAddress();
40 void implRead(
char * buffer, std::size_t bufferLen);
42 void implWrite(
const std::vector<ByteBuffer> & buffers);
45 AsioNetworkSession &toBeNotified,
47 std::size_t bufferLen);
55 void implCloseAfterWrite();
57 bool implIsConnected();
59 ClientTransportAutoPtr implCreateClientTransport();
61 void implTransferNativeFrom(ClientTransport & clientTransport);
63 int getNativeHandle();
67 AsioSocketPtr mSocketPtr;
72 class RCF_EXPORT TcpServerTransport :
73 public AsioServerTransport,
74 public IpServerTransport
77 TcpServerTransport(
const IpAddress & ipAddress);
78 TcpServerTransport(
const std::string & ip,
int port);
80 TransportType getTransportType();
82 ServerTransportPtr clone();
89 AsioNetworkSessionPtr implCreateNetworkSession();
92 void onServerStart(RcfServer & server);
94 ClientTransportAutoPtr implCreateClientTransport(
95 const Endpoint &endpoint);
105 #endif // ! INCLUDE_RCF_TCPSERVERTRANSPORT_HPP