Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
websocketpp::message_buffer Namespace Reference

Namespaces

namespace  alloc
 
namespace  pool
 

Classes

class  message
 Represents a buffer for a single WebSocket message. More...
 

Functions

template<typename T >
void message_deleter (T *msg)
 Custom deleter for use in shared_ptrs to message.
 

Function Documentation

◆ message_deleter()

template<typename T >
void websocketpp::message_buffer::message_deleter ( T * msg)

This is used to catch messages about to be deleted and offer the manager the ability to recycle them instead. Message::recycle will return true if it was successfully recycled and false otherwise. In the case of exceptions or error this deleter frees the memory.

Definition at line 84 of file pool.hpp.

84 {
85 try {
86 if (!msg->recycle()) {
87 delete msg;
88 }
89 } catch (...) {
90 // TODO: is there a better way to ensure this function doesn't throw?
91 delete msg;
92 }
93}