void init_send( TCPConnection::Ptr conn, SignalFrame & buffer )
 {
   conn->send( buffer,
               boost::bind( &Server::callback_send,
                            this,
                            conn, // 1st param for the callback fct
                            asio::placeholders::error // 2nd param
                          )
             );
 }
Exemplo n.º 2
0
void ServerNetworkComm::init_send( TCPConnection::Ptr client, SignalFrame & frame )
{
  if( is_not_null(client) )
  {
    client->send( frame,
                  boost::bind( &ServerNetworkComm::callback_send,
                               this,
                               client,
                               asio::placeholders::error
                               )
                  );
  }
  else // if the connection is null, broadcast the frame
  {
    std::map<TCPConnection::Ptr, ClientInfo>::iterator it = m_clients.begin();

    for( ; it != m_clients.end() ; ++it )
      init_send( it->first, frame );
  }
}