| 1053 | } |
| 1054 | |
| 1055 | void SAMSocket::HandleReceived (const boost::system::error_code& ecode, std::size_t bytes_transferred) |
| 1056 | { |
| 1057 | m_IsReceiving = false; |
| 1058 | if (ecode) |
| 1059 | { |
| 1060 | LogPrint (eLogError, "SAM: Read error: ", ecode.message ()); |
| 1061 | if (ecode != boost::asio::error::operation_aborted) |
| 1062 | Terminate ("read error"); |
| 1063 | } |
| 1064 | else |
| 1065 | { |
| 1066 | if (m_Stream) |
| 1067 | { |
| 1068 | m_Stream->AsyncSend ((uint8_t *)m_Buffer, bytes_transferred, |
| 1069 | std::bind(&SAMSocket::HandleStreamSend, shared_from_this(), std::placeholders::_1)); |
| 1070 | Receive (); |
| 1071 | } |
| 1072 | else |
| 1073 | Terminate("No Stream Remaining"); |
| 1074 | } |
| 1075 | } |
| 1076 | |
| 1077 | void SAMSocket::I2PReceive () |
| 1078 | { |