本文整理汇总了C++中OutputStream::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputStream::reset方法的具体用法?C++ OutputStream::reset怎么用?C++ OutputStream::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputStream
的用法示例。
在下文中一共展示了OutputStream::reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
HCHANNEL D3DCore_Impl::Stream_Play(HSTREAM stream, bool loop, int volume)
{
if(m_pADevice && stream != 0)
{
OutputStream* OStream = (OutputStream*)stream;
OStream->setRepeat( loop );
OStream->setVolume( m_VolStream * (volume/100.0f) );
OStream->reset();
OStream->play();
// StreamChannelList.insert(stream);
return stream;
}
else return 0;
}
示例2: request
//.........这里部分代码省略.........
BufferIn.dwStructSize = sizeof( INTERNET_BUFFERS ); // Must be set or error will occur
BufferIn.Next = NULL;
BufferIn.lpcszHeader = headers.c_str();
BufferIn.dwHeadersLength = headers.length();
BufferIn.dwHeadersTotal = 0;
BufferIn.lpvBuffer = NULL;
BufferIn.dwBufferLength = 0;
BufferIn.dwBufferTotal = 0; //contentLen;
BufferIn.dwOffsetLow = 0;
BufferIn.dwOffsetHigh = 0;
do {
retry = false;
if (!HttpSendRequestEx(req, &BufferIn, NULL, HSR_INITIATE, 0)) {
DWORD err = GetLastError();
if (err == ERROR_INTERNET_SEC_CERT_REV_FAILED && retryFlagRevocation) {
LOG.info("%s: error ERROR_INTERNET_SEC_CERT_REV_FAILED: retry once a time", __FUNCTION__);
DWORD dwFlags, dwBuffLen = sizeof(dwFlags);
InternetQueryOption (req, INTERNET_OPTION_SECURITY_FLAGS, (LPVOID)&dwFlags, &dwBuffLen);
dwFlags |= SECURITY_FLAG_IGNORE_REVOCATION;
InternetSetOption (req, INTERNET_OPTION_SECURITY_FLAGS, &dwFlags, sizeof (dwFlags));
retryFlagRevocation = false;
retry = true;
continue;
}
const char* msg = createHttpErrorMessage(err);
LOG.error("HttpSendRequestEx failed: code %d: %s", err, msg);
delete [] msg;
return StatusNetworkError;
}
#ifdef USE_ZLIB
if (compression_enabled) {
if (sendData((const char *)cBuf, cBufLen) != 0) {
delete [] cBuf;
delete [] chunkToSend;
return StatusWritingError;
}
delete [] cBuf;
}
#endif
if (!sendDataAtOnce) {
int64_t bufferSize = std::min(requestChunkSize, contentLen);
chunkToSend = new char[bufferSize+1];
while ((readBytes = data.read((void *)chunkToSend, bufferSize))) {
if (sendData(chunkToSend, readBytes) != 0) {
delete [] chunkToSend;
return StatusWritingError;
}
fireTransportEvent(readBytes, DATA_SENT);
}
}
delete [] chunkToSend;
if (data.error()) {
LOG.error("[%s] Input stream read error: %d on %d bytes read", __FUNCTION__, data.getPosition(), data.getTotalSize());
return StatusStreamReadingError;
}
if (!HttpEndRequest(req, NULL, 0, 0)) {
DWORD err = GetLastError();
const char* msg = createHttpErrorMessage(err);
LOG.error("HttpEndRequest failed: code %d: %s", err, msg);
delete [] msg;
return StatusNetworkError;
}
readResponseHeaders();
ret = checkResponseStatus();
if (ret == ERROR_INTERNET_FORCE_RETRY) {
retry = true;
}
} while (retry == true);
if (isErrorStatus(ret)) {
return ret;
}
StringBuffer nullval(NULL);
if ((getRequestHeaders().get(HTTP_HEADER_RANGE) != nullval) && ret == 200) {
// it means the client asks a partial response but the server doesn't support it.
// the right answer from server is HTTP 206
LOG.info("%s: client asks a Range, but server responds 200 instead of 206 (Partial Content). Reset the outputstream and start from scratch.", __FUNCTION__);
response.reset();
}
if (readResponse(response) != 0) {
return StatusReadingError;
}
return ret;
}
示例3: wrap_reset
static int wrap_reset(lua_State* L) {
lua_settop(L, 1);
OutputStream* self = luaAudiere_checkOutputStream(L, 1);
self->reset();
return 0;
}