6 #ifndef _INC_cNetStream_H
7 #define _INC_cNetStream_H
43 virtual void OnClose()
86 if (!m_bAsync || m_bInpThrottled)
100 if (!m_bAsync || m_bInpThrottled)
112 virtual HRESULT onEventWrite();
116 void OnEvent(WORD wEvent,
LSTATUS wError);
131 virtual HRESULT WriteX(
const void* pData,
size_t nDataSize)
override;
132 virtual HRESULT ReadX(
void* pData,
size_t nDataSize)
override;
133 virtual size_t SetSeekSizeMin(
size_t nSizeMin = k_FILE_BLOCK_SIZE)
override;
135 virtual void Close();
140 m_StatInp.m_tLast.InitTimeNow();
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define DEBUG_CHECK(exp)
Definition: cDebugAssert.h:90
bool isValidSocket() const noexcept
Definition: cNetSocket.h:109
Definition: cNetSocket.h:185
bool isConnecting() const noexcept
Definition: cNetSocket.h:302
HASHCODE_t get_HashCode() const noexcept
Definition: cNetSocket.h:345
bool isConnected() const noexcept
Definition: cNetSocket.h:311
SOCKETSTATE_TYPE m_eState
What is the state of the socket. e.g. SOCKETSTATE_Disconnected.
Definition: cNetSocket.h:195
void SetStateEstablished() noexcept
Definition: cNetSocket.h:331
int get_ReadReady() const
Definition: cNetSocket.cpp:716
Definition: cNetStream.h:20
bool isInputEmpty() const
Definition: cNetStream.h:83
bool isInputDesired() const
Definition: cNetStream.h:78
bool isConnecting() const noexcept
Definition: cNetStream.h:60
ITERATE_t get_InputQty() const
Definition: cNetStream.h:98
bool isValidSocket() const noexcept
Definition: cNetStream.h:65
bool m_bInpThrottled
The m_bAsync input was throttled. we cant rely on m_bAsync OnEvent to notify us again....
Definition: cNetStream.h:33
HASHCODE_t get_HashCode() const noexcept
Definition: cNetStream.h:71
UNITTEST_FRIEND(cNetStream)
ITERATE_t get_OutputQty() const
Definition: cNetStream.h:106
bool isConnected() const
Definition: cNetStream.h:55
cStreamQueue m_binp
raw input buffer from m_Socket. can read from this externally if m_bAsync.
Definition: cNetStream.h:35
cStreamQueue m_bout
raw output buffer to m_Socket. can write to this externally if m_bAsync.
Definition: cNetStream.h:34
cStreamOutput * get_StreamOut()
Definition: cNetStream.h:121
cStreamInput * get_StreamInp()
Definition: cNetStream.h:125
cNetSocket m_Socket
the raw TCP SOCKET we are buffering to/from.
Definition: cNetStream.h:31
bool isOutputEmpty() const
Definition: cNetStream.h:93
HRESULT m_hResultRx
The status of the connect or disconnect. S_OK = connected. else how to it close ? don't return this u...
Definition: cNetStream.h:36
bool m_bAsync
Will this socket be using OnEvent FD_READ FD_WRITE events ?
Definition: cNetStream.h:32
void SetStateEstablished()
Definition: cNetStream.h:137
ITERATE_t get_ReadQty() const
Definition: cQueue.h:60
bool isEmptyQ() const noexcept
Definition: cQueue.h:41
ITERATE_t get_GrowSizeChunk() const noexcept
Definition: cQueue.h:640
static const size_t k_FILE_BLOCK_SIZE
default arbitrary transfer block size. more than this is NOT more efficient.
Definition: cStream.h:89
Definition: cStream.h:126
Definition: cStreamQueue.h:19
Definition: cStream.h:456
Definition: cThreadLock.h:205
@ SOCKETSTATE_Disconnected
error indicates a remote disconnect. dead socket. not functional socket.
Definition: cNetSocket.h:49
UNITTEST2_PREDEF(cQuadtree)
LONG_PTR STREAM_OFFSET_t
Might be 64 or 32 bit. TODO SET USE_FILE_POS64.
Definition: cOSHandle.h:52
LONG LSTATUS
AKA error_status_t. FACILITY_WIN32 codes returned from RegCreateKeyEx() etc. Maybe NOT GetLastError()...
Definition: HResult.h:74
LONG_PTR STREAM_SEEKRET_t
return from Seek()
Definition: cOSHandle.h:53
int ITERATE_t
like size_t but signed
Definition: Index.h:28
UINT_PTR HASHCODE_t
could hold a pointer converted to a number? maybe 64 or 32 bit ? same as size_t.
Definition: GrayCore.h:116
SEEK_ORIGIN_TYPE
Definition: cOSHandle.h:34