face/tcp: Implementing mock version of TcpFace
The real version should avoid all exceptions in the processing path, enable lazy decoding of Interest/Data packets, and implement LocalControlHeader processing and association with Interest/Data packets. Change-Id: Ied907b3d10b7110a1dcc05d0d6d3c0dd277df8e1 refs: #1132, #1133, #1134, #1135
This commit is contained in:
1 parent
855a53c51e
commit
d32cb9657c
6 files changed
+150
-21
No files matched your search
@@ -8,20 +8,30 @@
|
||||
|
||||
namespace ndn {
|
||||
|
||||
TcpFace::TcpFace(FaceId id, const shared_ptr<TcpFace::protocol::socket>& socket)
|
||||
: StreamFace<protocol>(id)
|
||||
, m_socket(socket)
|
||||
TcpFace::TcpFace(FaceId id,
|
||||
const shared_ptr<TcpFace::protocol::socket>& socket)
|
||||
: StreamFace<protocol>(id, socket)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
TcpFace::sendInterest(const Interest& interest)
|
||||
{
|
||||
m_socket->async_send(boost::asio::buffer(interest.wireEncode().wire(),
|
||||
interest.wireEncode().size()),
|
||||
bind(&TcpFace::handleSend, this, _1, interest.wireEncode()));
|
||||
|
||||
// anything else should be done here?
|
||||
}
|
||||
|
||||
void
|
||||
TcpFace::sendData(const Data& data)
|
||||
{
|
||||
m_socket->async_send(boost::asio::buffer(data.wireEncode().wire(),
|
||||
data.wireEncode().size()),
|
||||
bind(&TcpFace::handleSend, this, _1, data.wireEncode()));
|
||||
|
||||
// anything else should be done here?
|
||||
}
|
||||
|
||||
} // namespace ndn
|
||||
Reference in new issue
Block a user