本文整理汇总了C++中PacketBuffer::rewind方法的典型用法代码示例。如果您正苦于以下问题:C++ PacketBuffer::rewind方法的具体用法?C++ PacketBuffer::rewind怎么用?C++ PacketBuffer::rewind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketBuffer
的用法示例。
在下文中一共展示了PacketBuffer::rewind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: valid
/**
Creates and posts a PacketBuffer::pcClosed message to the server message
que. The message contains the socket handle, and the ip address in dotted
decimal format. The socket you pass in is the socket that you are
removing. The socket should still be valid (not yet deleted) when this method
is called.
\param s Pointer to the socket that is being removed.
**/
void
SimpleServer::queClosedMessage(ServerSocket* s)
{
PacketBuffer* pktRemove = new PacketBuffer(PacketBuffer::pcClosed);
*pktRemove << (signed32) s->getSocket();
*pktRemove << s->getAddr().dottedDecimal();
pktRemove->rewind();
PacketMessage* pmsg = new PacketMessage(s,pktRemove); //socket is no longer valid
m_que.add(pmsg);
}