summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-02-22 11:42:32 -0800
committerJosh Blum <josh@joshknows.com>2010-02-22 11:42:32 -0800
commitd42e588d76efc41d18dabc75027347fe123904d1 (patch)
tree6a9eccb81538179be69d59677e465e15777202ae /host/include
parent9c9c96896cb38054e84213aa222883d34c7dd07b (diff)
downloaduhd-d42e588d76efc41d18dabc75027347fe123904d1.tar.gz
uhd-d42e588d76efc41d18dabc75027347fe123904d1.tar.bz2
uhd-d42e588d76efc41d18dabc75027347fe123904d1.zip
Moved the udp implementation guts into the cpp file
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/transport/udp.hpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/host/include/uhd/transport/udp.hpp b/host/include/uhd/transport/udp.hpp
index 6db6bd377..554234b43 100644
--- a/host/include/uhd/transport/udp.hpp
+++ b/host/include/uhd/transport/udp.hpp
@@ -30,44 +30,33 @@ public:
typedef boost::shared_ptr<udp> sptr;
/*!
- * Constructor.
+ * Make a new udp transport.
* The address will be resolved, it can be a host name or ipv4.
* The port will be resolved, it can be a port type or number.
* \param addr a string representing the destination address
* \param port a string representing the destination port
* \param bcast if true, enable the broadcast option on the socket
*/
- udp(const std::string &addr, const std::string &port, bool bcast = false);
-
- /*!
- * Destructor
- */
- ~udp(void);
+ static sptr make(const std::string &addr, const std::string &port, bool bcast = false);
/*!
* Send a vector of buffer (like send_msg).
* \param buffs a vector of asio buffers
*/
- void send(const std::vector<boost::asio::const_buffer> &buffs);
+ virtual void send(const std::vector<boost::asio::const_buffer> &buffs) = 0;
/*!
* Send a single buffer.
* \param buff single asio buffer
*/
- void send(const boost::asio::const_buffer &buff);
+ virtual void send(const boost::asio::const_buffer &buff) = 0;
/*!
* Receive a buffer. The memory is managed internally.
* Calling recv will invalidate the buffer of the previous recv.
* \return a shared iovec with allocated memory
*/
- uhd::shared_iovec recv(void);
-
-private:
- boost::asio::ip::udp::socket *_socket;
- boost::asio::ip::udp::endpoint _receiver_endpoint;
- boost::asio::ip::udp::endpoint _sender_endpoint;
- boost::asio::io_service _io_service;
+ virtual uhd::shared_iovec recv(void) = 0;
};
}} //namespace