Sirikata
|
A collection of simpling framing routines for network messages you want to send on a stream. More...
#include <Frame.hpp>
Static Public Member Functions | |
static std::string | write (const void *data, uint32 len) |
Writes the data to the stream as a message. | |
static std::string | write (const std::string &data) |
static std::string | parse (std::string &data) |
Checks if a full message is available. |
A collection of simpling framing routines for network messages you want to send on a stream.
This just provides utilities for writing a frame around the data and reading them back, avoiding duplicated error-prone code.
std::string Sirikata::Network::Frame::parse | ( | std::string & | data | ) | [static] |
Checks if a full message is available.
Returns the contents and removes them from the argument if it has a whole packet; returns an empty string and does nothing to the argument if it does not have a whole packet.
Referenced by Sirikata::OH::Simple::SimpleObjectQueryProcessor::handleProximitySubstreamRead(), Sirikata::OH::Manual::ServerQueryHandler::handleProximitySubstreamRead(), Sirikata::LibproxProximityBase::ProxStreamInfo< EndpointType, StreamType >::handleRead(), Sirikata::RecordSSTStream< ODPSST::Stream::Ptr >::handleRead(), and Sirikata::JS::EmersonMessagingManager::handleScriptCommStreamRead().
std::string Sirikata::Network::Frame::write | ( | const void * | data, |
uint32 | len | ||
) | [static] |
Writes the data to the stream as a message.
Referenced by Sirikata::LibproxProximityBase::sendObjectHostResult(), Sirikata::LibproxProximityBase::sendObjectResult(), Sirikata::OH::Manual::ServerQueryHandler::sendReplicatedClientProxMessage(), write(), Sirikata::RecordSSTStream< ODPSST::Stream::Ptr >::write(), and Sirikata::JS::EmersonMessagingManager::writeMessageSubstream().
std::string Sirikata::Network::Frame::write | ( | const std::string & | data | ) | [static] |
References write().