blob: 4a295ff41f073259ec0d988652258b43de5cce72 [file] [log] [blame]
Alexander Afanasyeva9034b02014-01-26 18:32:02 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (C) 2014 Named Data Networking Project
4 * See COPYING for copyright and distribution information.
5 */
6
7#include "tcp-face.hpp"
8
Alexander Afanasyev18bbf812014-01-29 01:40:23 -08009namespace nfd {
Alexander Afanasyeva9034b02014-01-26 18:32:02 -080010
Junxiao Shi8c8d2182014-01-30 22:33:00 -070011TcpFace::TcpFace(const shared_ptr<TcpFace::protocol::socket>& socket)
12 : StreamFace<protocol>(socket)
Alexander Afanasyeva9034b02014-01-26 18:32:02 -080013{
14}
15
Alexander Afanasyev8ad71ba2014-01-27 00:07:14 -080016void
17TcpFace::sendInterest(const Interest& interest)
18{
Alexander Afanasyevd32cb962014-01-28 12:43:47 -080019 m_socket->async_send(boost::asio::buffer(interest.wireEncode().wire(),
20 interest.wireEncode().size()),
21 bind(&TcpFace::handleSend, this, _1, interest.wireEncode()));
22
23 // anything else should be done here?
Alexander Afanasyev8ad71ba2014-01-27 00:07:14 -080024}
25
26void
27TcpFace::sendData(const Data& data)
28{
Alexander Afanasyevd32cb962014-01-28 12:43:47 -080029 m_socket->async_send(boost::asio::buffer(data.wireEncode().wire(),
30 data.wireEncode().size()),
31 bind(&TcpFace::handleSend, this, _1, data.wireEncode()));
32
33 // anything else should be done here?
Alexander Afanasyev8ad71ba2014-01-27 00:07:14 -080034}
35
Alexander Afanasyev18bbf812014-01-29 01:40:23 -080036} // namespace nfd