Files
NFD/daemon/face/tcp-face.cpp
T
Junxiao Shi 8c8d2187b3 fw: integrate forwarder, strategy, tables
refs #1131, #1136

Change-Id: Ica58341cdc1ea1dc421693a87f35fc50177a707d
2014-01-31 00:53:45 -07:00

37 lines
993 B
C++

/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (C) 2014 Named Data Networking Project
* See COPYING for copyright and distribution information.
*/
#include "tcp-face.hpp"
namespace nfd {
TcpFace::TcpFace(const shared_ptr<TcpFace::protocol::socket>& socket)
: StreamFace<protocol>(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 nfd