Sirikata
Namespaces | Classes | Typedefs | Enumerations | Functions
Sirikata::Network Namespace Reference

Network contains Stream and TCPStream. More...

Namespaces

namespace  ASIOStreamBuilder

Classes

class  Address
 Provides a protocol-independent address layer for connecting to a target Takes a name and a service (for TCP that would be computer ip address and numeric port. More...
class  InternalIOWork
 Simple wrapper around Boost.Asio's io_service::work, allowing for safe, cross-platform allocation and use. More...
class  InternalIOStrand
 Simple wrapper around Boost.Asio's io_service::strand, allowing for safe, cross-platform allocation and use. More...
class  TCPSocket
 Simple wrapper around Boost.Asio's tcp::socket, allowing for safe, cross-platform allocation and use. More...
class  TCPListener
 Simple wrapper around Boost.Asio's tcp::acceptor, allowing for safe, cross-platform allocation and use. More...
class  TCPResolver
 Simple wrapper around Boost.Asio's tcp::resolver, allowing for safe, cross-platform allocation and use. More...
class  UDPSocket
 Simple wrapper around Boost.Asio's udp::socket, allowing for safe, cross-platform allocation and use. More...
class  UDPResolver
 Simple wrapper around Boost.Asio's udp::resolver, allowing for safe, cross-platform allocation and use. More...
class  DeadlineTimer
 Simple wrapper around Boost.Asio's deadline_timer, allowing for error-prone, cross-platform allocation and use. More...
struct  Frame
 A collection of simpling framing routines for network messages you want to send on a stream. More...
class  IOService
 IOService provides queuing, processing, and dispatch for asynchronous IO, including timers, sockets, resolvers, and simple tasks. More...
class  IOServicePool
 IOServicePool creates a pool of IOService threads for handling IO events. More...
class  IOStrand
 IOStrands provide guaranteed serialized event handling. More...
class  IOTimer
 A timer which handles events using an IOService. More...
class  IOWork
 Class that indicates that work is currently in process on an IOService, so that IOService should continue processing. More...
class  Stream
 Stream interface for network connections. More...
class  StreamFactory
class  StreamListener
 This class waits on a service and listens for incoming connections It calls the callback whenever such connections are encountered. More...
class  StreamListenerFactory
class  ASIOConnectAndHandshake
struct  ASIOReadBufferUtil
class  ASIOReadBuffer
class  ASIOSocketWrapper
class  CheckWebSocketHeader
class  MultiplexedSocket
class  TCPSetCallbacks
class  TCPStream
 This is a particular example implementation of the Stream interface sitting atop TCP. More...
class  TCPStreamListener
 This class waits on a service and listens for incoming connections It calls the callback whenever such connections are encountered. More...

Typedefs

typedef
boost::asio::ip::tcp::socket 
InternalTCPSocket
typedef
boost::asio::ip::tcp::acceptor 
InternalTCPAcceptor
typedef
boost::asio::ip::tcp::resolver 
InternalTCPResolver
typedef
boost::asio::ip::udp::socket 
InternalUDPSocket
typedef
boost::asio::ip::udp::resolver 
InternalUDPResolver
typedef boost::asio::io_service InternalIOService
typedef std::tr1::function< void()> IOCallback
typedef std::tr1::shared_ptr
< IOStrand
IOStrandPtr
typedef std::tr1::shared_ptr
< IOTimer
IOTimerPtr
typedef std::tr1::weak_ptr
< IOTimer
IOTimerWPtr
typedef std::tr1::shared_ptr
< MultiplexedSocket
MultiplexedSocketPtr
typedef std::tr1::weak_ptr
< MultiplexedSocket
MultiplexedSocketWPtr
typedef std::tr1::shared_ptr
< ASIOConnectAndHandshake
ASIOConnectAndHandshakePtr
typedef boost::asio::deadline_timer deadline_timer
typedef std::tr1::shared_ptr
< deadline_timer
deadline_timer_ptr
typedef
boost::posix_time::microseconds 
posix_microseconds

Enumerations

enum  StreamReliability { Unreliable, ReliableUnordered, ReliableOrdered }
 Indicates which combination of reliability and ordered-ness should be used. More...

Functions

void BufferPrint (void *pointerkey, const char extension[16], const void *vbuf, size_t size)
ASIOReadBufferMakeASIOReadBuffer (const MultiplexedSocketPtr &parentSocket, unsigned int whichSocket, const MemoryReference &strayBytesAfterHeader, TCPStream::StreamType streamType)
 The only public interface to TCPReadBuffer is the constructor-like-function which takes in a MultiplexedSocket and an integer offset.
void ASIOLogBuffer (void *pointerkey, const char extension[16], const uint8 *buffer, size_t buffersize)
char toHex (unsigned char a)
void copyHeader (void *destination, const char *stringPrefix, const UUID &key, unsigned int num)
int translateBase64 (uint8 *destination, const uint8 *source, int numSigBytes)
Sirikata::Network::Address convertEndpointToAddress (const boost::asio::ip::tcp::endpoint &ep)
void triggerMultiplexedConnectionError (MultiplexedSocket *, ASIOSocketWrapper *, const boost::system::error_code &error)

Detailed Description

Network contains Stream and TCPStream.


Typedef Documentation

typedef boost::asio::deadline_timer Sirikata::Network::deadline_timer
typedef boost::asio::io_service Sirikata::Network::InternalIOService
typedef boost::asio::ip::tcp::acceptor Sirikata::Network::InternalTCPAcceptor
typedef boost::asio::ip::tcp::resolver Sirikata::Network::InternalTCPResolver
typedef boost::asio::ip::tcp::socket Sirikata::Network::InternalTCPSocket
typedef boost::asio::ip::udp::resolver Sirikata::Network::InternalUDPResolver
typedef boost::asio::ip::udp::socket Sirikata::Network::InternalUDPSocket
typedef std::tr1::function<void()> Sirikata::Network::IOCallback
typedef std::tr1::shared_ptr<IOStrand> Sirikata::Network::IOStrandPtr
typedef std::tr1::shared_ptr<IOTimer> Sirikata::Network::IOTimerPtr
typedef std::tr1::weak_ptr<IOTimer> Sirikata::Network::IOTimerWPtr
typedef boost::posix_time::microseconds Sirikata::Network::posix_microseconds

Enumeration Type Documentation

Indicates which combination of reliability and ordered-ness should be used.

Enumerator:
Unreliable 
ReliableUnordered 
ReliableOrdered 

Function Documentation

void Sirikata::Network::ASIOLogBuffer ( void *  pointerkey,
const char  extension[16],
const uint8 *  buffer,
size_t  buffersize 
)

Referenced by BufferPrint().

void Sirikata::Network::BufferPrint ( void *  pointerkey,
const char  extension[16],
const void *  vbuf,
size_t  size 
)
Sirikata::Network::Address Sirikata::Network::convertEndpointToAddress ( const boost::asio::ip::tcp::endpoint &  ep)
void Sirikata::Network::copyHeader ( void *  destination,
const char *  stringPrefix,
const UUID &  key,
unsigned int  num 
)
ASIOReadBuffer * Sirikata::Network::MakeASIOReadBuffer ( const MultiplexedSocketPtr &  parentSocket,
unsigned int  whichSocket,
const MemoryReference &  strayBytesAfterHeader,
TCPStream::StreamType  streamType 
)

The only public interface to TCPReadBuffer is the constructor-like-function which takes in a MultiplexedSocket and an integer offset.

Parameters:
parentSocketthe MultiplexedSocket which defines the whole connection (if the weak_ptr fails, the connection is bunk
whichSocketindicates which substream this read buffer is for, so the appropriate ASIO socket can be retrieved

References Sirikata::Network::ASIOReadBuffer::asioReadIntoFixedBuffer(), Sirikata::DataReference< T >::data(), Sirikata::Network::ASIOReadBuffer::mBuffer, Sirikata::Network::ASIOReadBuffer::readIntoFixedBuffer(), and Sirikata::DataReference< T >::size().

Referenced by Sirikata::Network::ASIOConnectAndHandshake::checkHeaderContents(), and Sirikata::Network::MultiplexedSocket::sendAllProtocolHeaders().

char Sirikata::Network::toHex ( unsigned char  a)
int Sirikata::Network::translateBase64 ( uint8 *  destination,
const uint8 *  source,
int  numSigBytes 
)
void Sirikata::Network::triggerMultiplexedConnectionError ( MultiplexedSocket *  socket,
ASIOSocketWrapper *  wrapper,
const boost::system::error_code &  error 
)