face+transport: Cleanup and preparation for implementation of fully async Face operations
Change-Id: I7816b6a9c99a0cf4825459b9652372d6585a5191
diff --git a/include/ndn-cpp/transport/unix-transport.hpp b/include/ndn-cpp/transport/unix-transport.hpp
index bb77bb4..1cc4758 100644
--- a/include/ndn-cpp/transport/unix-transport.hpp
+++ b/include/ndn-cpp/transport/unix-transport.hpp
@@ -13,49 +13,24 @@
namespace ndn {
-class UnixTransport : public Transport {
+class UnixTransport : public Transport
+{
public:
UnixTransport(const std::string &unixSocket = "/tmp/.ndnd.sock");
~UnixTransport();
- /**
- * Connect according to the info in ConnectionInfo, and processEvents() will use elementListener.
- * @param connectionInfo A reference to a TcpTransport::ConnectionInfo.
- * @param elementListener Not a shared_ptr because we assume that it will remain valid during the life of this object.
- */
+ // from Transport
virtual void
- connect(ElementListener& elementListener);
+ connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback);
- /**
- * Set data to the host
- * @param data A pointer to the buffer of data to send.
- * @param dataLength The number of bytes in data.
- */
- virtual void
- send(const uint8_t *data, size_t dataLength);
-
- /**
- * Process any data to receive. For each element received, call elementListener.onReceivedElement.
- * This is non-blocking and will return immediately if there is no data to receive.
- * You should normally not call this directly since it is called by Face.processEvents.
- * @throw This may throw an exception for reading data or in the callback for processing the data. If you
- * call this from an main event loop, you may want to catch and log/disregard all exceptions.
- */
- virtual void
- processEvents();
-
- virtual bool
- getIsConnected();
-
- /**
- * Close the connection to the host.
- */
virtual void
close();
+
+ virtual void
+ send(const Block &wire);
private:
std::string unixSocket_;
- bool isConnected_;
class Impl;
std::auto_ptr<Impl> impl_;