Example #1
0
 void WsConnection::onConnEvent(const ConnectionPtr_t& conn, ConnEvent event, const void* context)
 {
     switch(event)
     {
         case Conn_ReadEvent:
             {
                 const StackBuffer* buffer = (const StackBuffer*)context;
                 onRead(conn, buffer->buffer, buffer->count);
             }
             break;    
         case Conn_WriteCompleteEvent:
             {
                 m_sendCallback();
                 m_sendCallback = std::bind(&dummyCallback);    
             }
             break;
         default:
             break;
     }
 }
Example #2
0
void SocketCommand::Ack(uint32_t payloadLen, const uint8_t* payloadPtr) const
{
    m_sendCallback(payloadLen, payloadPtr);
}