本文整理汇总了C++中Serialiser::SerialiseString方法的典型用法代码示例。如果您正苦于以下问题:C++ Serialiser::SerialiseString方法的具体用法?C++ Serialiser::SerialiseString怎么用?C++ Serialiser::SerialiseString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Serialiser
的用法示例。
在下文中一共展示了Serialiser::SerialiseString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoteAccessServerThread
void RenderDoc::RemoteAccessServerThread(void *s)
{
Threading::KeepModuleAlive();
Network::Socket *sock = (Network::Socket *)s;
RenderDoc::Inst().m_SingleClientName = "";
Threading::ThreadHandle clientThread = 0;
RenderDoc::Inst().m_RemoteClientThreadShutdown = false;
while(!RenderDoc::Inst().m_RemoteServerThreadShutdown)
{
Network::Socket *client = sock->AcceptClient(false);
if(client == NULL)
{
if(!sock->Connected())
{
RDCERR("Error in accept - shutting down server");
SAFE_DELETE(sock);
Threading::ReleaseModuleExitThread();
return;
}
Threading::Sleep(5);
continue;
}
string existingClient;
string newClient;
bool kick = false;
// receive handshake from client and get its name
{
PacketType type;
Serialiser *ser = NULL;
if(!RecvPacket(client, type, &ser))
{
SAFE_DELETE(ser);
SAFE_DELETE(client);
continue;
}
if(type != ePacket_Handshake)
{
SAFE_DELETE(ser);
SAFE_DELETE(client);
continue;
}
ser->SerialiseString("", newClient);
ser->Serialise("", kick);
SAFE_DELETE(ser);
if(newClient.empty())
{
SAFE_DELETE(client);
continue;
}
}
// see if we have a client
{
SCOPED_LOCK(RenderDoc::Inst().m_SingleClientLock);
existingClient = RenderDoc::Inst().m_SingleClientName;
}
if(!existingClient.empty() && kick)
{
// forcibly close communication thread which will kill the connection
RenderDoc::Inst().m_RemoteClientThreadShutdown = true;
Threading::JoinThread(clientThread);
Threading::CloseThread(clientThread);
clientThread = 0;
RenderDoc::Inst().m_RemoteClientThreadShutdown = false;
existingClient = "";
}
if(existingClient.empty())
{
SCOPED_LOCK(RenderDoc::Inst().m_SingleClientLock);
RenderDoc::Inst().m_SingleClientName = newClient;
}
// if we've claimed client status, spawn a thread to communicate
if(existingClient.empty() || kick)
{
clientThread = Threading::CreateThread(RemoteAccessClientThread, client);
continue;
}
else
{
// if we've been asked to kick the existing connection off
// reject this connection and tell them who is busy
Serialiser ser("", Serialiser::WRITING, false);
//.........这里部分代码省略.........