mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 19:27:49 +02:00
always use TCP/IP sockets for I2CP
This commit is contained in:
parent
bf3d7e74f5
commit
48374d97df
2 changed files with 8 additions and 10 deletions
|
@ -274,7 +274,7 @@ namespace client
|
|||
}
|
||||
}
|
||||
|
||||
I2CPSession::I2CPSession (I2CPServer& owner, std::shared_ptr<proto::socket> socket):
|
||||
I2CPSession::I2CPSession (I2CPServer& owner, std::shared_ptr<boost::asio::ip::tcp::socket> socket):
|
||||
m_Owner (owner), m_Socket (socket), m_SessionID (0xFFFF),
|
||||
m_MessageID (0), m_IsSendAccepted (true), m_IsSending (false)
|
||||
{
|
||||
|
@ -939,7 +939,7 @@ namespace client
|
|||
I2CPServer::I2CPServer (const std::string& interface, int port, bool isSingleThread):
|
||||
RunnableService ("I2CP"), m_IsSingleThread (isSingleThread),
|
||||
m_Acceptor (GetIOService (),
|
||||
I2CPSession::proto::endpoint(boost::asio::ip::address::from_string(interface), port))
|
||||
boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(interface), port))
|
||||
{
|
||||
memset (m_MessagesHandlers, 0, sizeof (m_MessagesHandlers));
|
||||
m_MessagesHandlers[I2CP_GET_DATE_MESSAGE] = &I2CPSession::GetDateMessageHandler;
|
||||
|
@ -981,13 +981,13 @@ namespace client
|
|||
|
||||
void I2CPServer::Accept ()
|
||||
{
|
||||
auto newSocket = std::make_shared<I2CPSession::proto::socket> (GetIOService ());
|
||||
auto newSocket = std::make_shared<boost::asio::ip::tcp::socket> (GetIOService ());
|
||||
m_Acceptor.async_accept (*newSocket, std::bind (&I2CPServer::HandleAccept, this,
|
||||
std::placeholders::_1, newSocket));
|
||||
}
|
||||
|
||||
void I2CPServer::HandleAccept(const boost::system::error_code& ecode,
|
||||
std::shared_ptr<I2CPSession::proto::socket> socket)
|
||||
std::shared_ptr<boost::asio::ip::tcp::socket> socket)
|
||||
{
|
||||
if (!ecode && socket)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue