Add stream buffering (WIP)

This commit is contained in:
SirLynix
2022-04-09 18:22:57 +02:00
parent 2b66ea1e90
commit 22f58fdbf5
14 changed files with 291 additions and 189 deletions

View File

@@ -147,19 +147,6 @@ namespace Nz
return QueryAvailableBytes() == 0;
}
/*!
* \brief Gets the position of the cursor
* \return 0
*
* \remark Produces a NazaraError because it is a special stream
*/
UInt64 TcpClient::GetCursorPos() const
{
NazaraError("GetCursorPos() cannot be used on sequential streams");
return 0;
}
/*!
* \brief Gets the size of the raw memory available
* \return Size of the memory available
@@ -456,21 +443,6 @@ namespace Nz
return Send(ptr, size, nullptr);
}
/*!
* \brief Sets the position of the cursor
* \return false
*
* \param offset Offset according to the beginning of the stream
*
* \remark Produces a NazaraError because it is a special stream
*/
bool TcpClient::SetCursorPos(UInt64 /*offset*/)
{
NazaraError("SetCursorPos() cannot be used on sequential streams");
return false;
}
/*!
* \brief Waits for being connected before time out
* \return The new socket state, either Connected if connection did succeed or NotConnected if an error occurred
@@ -605,6 +577,32 @@ namespace Nz
UpdateState(SocketState::Connected);
}
/*!
* \brief Sets the position of the cursor
* \return false
*
* \param offset Offset according to the beginning of the stream
*
* \remark Produces a NazaraError because it is a special stream
*/
bool TcpClient::SeekStreamCursor(UInt64 /*offset*/)
{
NazaraError("SeekStreamCursor() cannot be used on sequential streams");
return false;
}
/*!
* \brief Gets the position of the cursor
* \return 0
*
* \remark Produces a NazaraError because it is a special stream
*/
UInt64 TcpClient::TellStreamCursor() const
{
NazaraError("TellStreamCursor() cannot be used on sequential streams");
return 0;
}
/*!
* \brief Writes blocks
* \return Number of blocks written