Files
allwpilib/wpiutil/src/main/native/include/wpi/raw_socket_istream.h

35 lines
1.0 KiB
C
Raw Normal View History

/*----------------------------------------------------------------------------*/
2018-01-01 17:32:39 -08:00
/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
2018-05-13 17:09:56 -07:00
#ifndef WPIUTIL_WPI_RAW_SOCKET_ISTREAM_H_
#define WPIUTIL_WPI_RAW_SOCKET_ISTREAM_H_
#include "wpi/raw_istream.h"
namespace wpi {
class NetworkStream;
class raw_socket_istream : public raw_istream {
public:
explicit raw_socket_istream(NetworkStream& stream, int timeout = 0)
: m_stream(stream), m_timeout(timeout) {}
void close() override;
2017-10-21 20:31:20 -07:00
size_t in_avail() const override;
private:
2017-10-21 20:31:20 -07:00
void read_impl(void* data, size_t len) override;
NetworkStream& m_stream;
int m_timeout;
};
} // namespace wpi
2018-05-13 17:09:56 -07:00
#endif // WPIUTIL_WPI_RAW_SOCKET_ISTREAM_H_