16 #ifndef INCLUDE_NN_NLIB_TCPINPUTSTREAM_H_ 17 #define INCLUDE_NN_NLIB_TCPINPUTSTREAM_H_ 20 #ifdef NLIB_SOCKET_ENABLED 27 struct TcpInputStreamSettings {
30 TcpInputStreamSettings() : buf(nullptr), buffer_size(8192) {}
35 TcpInputStream()
NLIB_NOEXCEPT : socket_(NLIB_SOCKET_INVALID), buf_(
nullptr), buf_size_(0),
36 buffer_holder_(
nullptr) {}
39 TcpInputStreamSettings settings;
40 return this->Init(sockfd, settings);
46 virtual size_t FillBuffer_(
void* p,
size_t nbytes) NLIB_NOEXCEPT
NLIB_OVERRIDE;
47 virtual bool Close_() NLIB_NOEXCEPT NLIB_OVERRIDE;
48 virtual
void* GetWorkBuffer_(
size_t* nbytes) NLIB_NOEXCEPT NLIB_OVERRIDE;
54 uint8_t* buffer_holder_;
62 #endif // INCLUDE_NN_NLIB_TCPINPUTSTREAM_H_ #define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
A file that contains the configuration information for each development environment.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.