summaryrefslogtreecommitdiff
path: root/src/lib/util.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-27 21:12:53 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-27 21:12:53 +0100
commit480a14fd2fd9937e2450c652f2953d5835f56239 (patch)
tree15bd9adfaa764aed0c06f868b2fa3cff9260c36e /src/lib/util.h
parent8b07c8131e535579f39c1899f063ccedc425eeb8 (diff)
Compiles.
Diffstat (limited to 'src/lib/util.h')
-rw-r--r--src/lib/util.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/util.h b/src/lib/util.h
index b3c1ebc05..1faef0cd3 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -28,6 +28,7 @@
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
+#include <boost/asio.hpp>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavfilter/avfilter.h>
@@ -41,7 +42,6 @@ extern void stacktrace (std::ostream &, int);
extern std::string audio_sample_format_to_string (AVSampleFormat);
extern AVSampleFormat audio_sample_format_from_string (std::string);
extern std::string dependency_version_summary ();
-extern void socket_write (int, uint8_t const *, int);
extern double seconds (struct timeval);
extern void dvdomatic_setup ();
extern std::vector<std::string> split_at_spaces_considering_quotes (std::string);
@@ -58,19 +58,21 @@ extern void md5_data (std::string, void const *, int);
/** @class SocketReader
* @brief A helper class from reading from sockets.
+ *
+ * You can probably do this stuff directly in boost, but I'm not sure how.
*/
class SocketReader
{
public:
- SocketReader (int);
+ SocketReader (boost::shared_ptr<boost::asio::ip::tcp::socket>);
void read_definite_and_consume (uint8_t *, int);
void read_indefinite (uint8_t *, int);
void consume (int);
private:
- /** file descriptor we are reading from */
- int _fd;
+ /** socket we are reading from */
+ boost::shared_ptr<boost::asio::ip::tcp::socket> _socket;
/** a buffer for small reads */
uint8_t _buffer[256];
/** amount of valid data in the buffer */