mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
set socket options
This commit is contained in:
parent
4fb0eeda37
commit
f32510e10a
|
@ -32,7 +32,12 @@ namespace client
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TCPIPPipe::TCPIPPipe(I2PService * owner, std::shared_ptr<boost::asio::ip::tcp::socket> upstream, std::shared_ptr<boost::asio::ip::tcp::socket> downstream) : I2PServiceHandler(owner), m_up(upstream), m_down(downstream) {}
|
TCPIPPipe::TCPIPPipe(I2PService * owner, std::shared_ptr<boost::asio::ip::tcp::socket> upstream, std::shared_ptr<boost::asio::ip::tcp::socket> downstream) : I2PServiceHandler(owner), m_up(upstream), m_down(downstream)
|
||||||
|
{
|
||||||
|
boost::asio::socket_base::receive_buffer_size option(TCP_IP_PIPE_BUFFER_SIZE);
|
||||||
|
upstream->set_option(option);
|
||||||
|
downstream->set_option(option);
|
||||||
|
}
|
||||||
|
|
||||||
TCPIPPipe::~TCPIPPipe()
|
TCPIPPipe::~TCPIPPipe()
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,11 +9,20 @@ namespace i2p
|
||||||
{
|
{
|
||||||
namespace client
|
namespace client
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/** set standard socket options */
|
||||||
|
static void I2PTunnelSetSocketOptions(std::shared_ptr<boost::asio::ip::tcp::socket> socket)
|
||||||
|
{
|
||||||
|
boost::asio::socket_base::receive_buffer_size option(I2P_TUNNEL_CONNECTION_BUFFER_SIZE);
|
||||||
|
socket->set_option(option);
|
||||||
|
}
|
||||||
|
|
||||||
I2PTunnelConnection::I2PTunnelConnection (I2PService * owner, std::shared_ptr<boost::asio::ip::tcp::socket> socket,
|
I2PTunnelConnection::I2PTunnelConnection (I2PService * owner, std::shared_ptr<boost::asio::ip::tcp::socket> socket,
|
||||||
std::shared_ptr<const i2p::data::LeaseSet> leaseSet, int port):
|
std::shared_ptr<const i2p::data::LeaseSet> leaseSet, int port):
|
||||||
I2PServiceHandler(owner), m_Socket (socket), m_RemoteEndpoint (socket->remote_endpoint ()),
|
I2PServiceHandler(owner), m_Socket (socket), m_RemoteEndpoint (socket->remote_endpoint ()),
|
||||||
m_IsQuiet (true)
|
m_IsQuiet (true)
|
||||||
{
|
{
|
||||||
|
I2PTunnelSetSocketOptions(m_Socket);
|
||||||
m_Stream = GetOwner()->GetLocalDestination ()->CreateStream (leaseSet, port);
|
m_Stream = GetOwner()->GetLocalDestination ()->CreateStream (leaseSet, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +31,7 @@ namespace client
|
||||||
I2PServiceHandler(owner), m_Socket (socket), m_Stream (stream),
|
I2PServiceHandler(owner), m_Socket (socket), m_Stream (stream),
|
||||||
m_RemoteEndpoint (socket->remote_endpoint ()), m_IsQuiet (true)
|
m_RemoteEndpoint (socket->remote_endpoint ()), m_IsQuiet (true)
|
||||||
{
|
{
|
||||||
|
I2PTunnelSetSocketOptions(m_Socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
I2PTunnelConnection::I2PTunnelConnection (I2PService * owner, std::shared_ptr<i2p::stream::Stream> stream,
|
I2PTunnelConnection::I2PTunnelConnection (I2PService * owner, std::shared_ptr<i2p::stream::Stream> stream,
|
||||||
|
@ -29,6 +39,7 @@ namespace client
|
||||||
I2PServiceHandler(owner), m_Socket (socket), m_Stream (stream),
|
I2PServiceHandler(owner), m_Socket (socket), m_Stream (stream),
|
||||||
m_RemoteEndpoint (target), m_IsQuiet (quiet)
|
m_RemoteEndpoint (target), m_IsQuiet (quiet)
|
||||||
{
|
{
|
||||||
|
I2PTunnelSetSocketOptions(m_Socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
I2PTunnelConnection::~I2PTunnelConnection ()
|
I2PTunnelConnection::~I2PTunnelConnection ()
|
||||||
|
|
Loading…
Reference in a new issue