WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
raw_socket_istream.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2015. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef NT_RAW_SOCKET_ISTREAM_H_
9 #define NT_RAW_SOCKET_ISTREAM_H_
10 
11 #include "raw_istream.h"
12 
13 #include "tcpsockets/NetworkStream.h"
14 
15 namespace nt {
16 
18  public:
19  raw_socket_istream(NetworkStream& stream, int timeout = 0)
20  : m_stream(stream), m_timeout(timeout) {}
21  virtual ~raw_socket_istream() = default;
22  virtual bool read(void* data, std::size_t len);
23  virtual void close();
24 
25  private:
26  NetworkStream& m_stream;
27  int m_timeout;
28 };
29 
30 } // namespace nt
31 
32 #endif // NT_RAW_SOCKET_ISTREAM_H_
Definition: NetworkStream.h:15
Definition: raw_socket_istream.h:17
Definition: raw_istream.h:15