예제 #1
0
  void ConnBoshMultStat::handleConnect( const ConnectionBase* /*connection*/ )
  {
    if( m_state == StateConnecting )
    {
/*FIXME: should be the same as the chessd-webclient*/
      m_rid = rand() % ((int)((900000.49999) - (100000.5))) + 100000;

      Tag requestBody( "body" );
/* based on chessd-bosh */
//      requestBody.setXmlns( XMLNS_XMPP_BOSH, "xmpp" );

//      requestBody.addAttribute( "content", "text/xml; charset=utf-8" );
      requestBody.addAttribute( "hold", (long)m_hold );
      requestBody.addAttribute( "rid", (long)m_rid );
      requestBody.addAttribute( "to", m_server );

      requestBody.addAttribute( "ver", "1.6" );
      requestBody.addAttribute( "wait", (long)m_wait );
//      requestBody.addAttribute( "ack", 0 );
//      requestBody.addAttribute( "secure", "false" );
//      requestBody.addAttribute( "route", "xmpp:" + m_server + ":5222" );
      requestBody.addAttribute( "xml:lang", "en" );

//      requestBody.addAttribute( "ack", 0 );
//      requestBody.addAttribute( "secure", "false" );
//      requestBody.addAttribute( "route", "xmpp:" + m_server + ":5222" );
//      requestBody.addAttribute( "xmpp:version", "1.0" );
      requestBody.setXmlns( XMLNS_HTTPBIND );

      m_logInstance.dbg( LogAreaClassConnectionBOSH, "sending bosh connection request" );
      sendRequest( requestBody.xml() );
    }
  }
예제 #2
0
  void ConnectionBOSH::handleConnect( const ConnectionBase* /*connection*/ )
  {
    if( m_state == StateConnecting )
    {
      m_rid = rand() % 100000 + 1728679472;

      Tag requestBody( "body" );
      requestBody.setXmlns( XMLNS_HTTPBIND );
      requestBody.setXmlns( XMLNS_XMPP_BOSH, "xmpp" );

      requestBody.addAttribute( "content", "text/xml; charset=utf-8" );
      requestBody.addAttribute( "hold", (long)m_hold );
      requestBody.addAttribute( "rid", (long)m_rid );
      requestBody.addAttribute( "ver", "1.6" );
      requestBody.addAttribute( "wait", (long)m_wait );
      requestBody.addAttribute( "ack", 0 );
      requestBody.addAttribute( "secure", "false" );
      requestBody.addAttribute( "route", "xmpp:" + m_server + ":5222" );
      requestBody.addAttribute( "xml:lang", "en" );
      requestBody.addAttribute( "xmpp:version", "1.0" );
      requestBody.addAttribute( "to", m_server );

      m_logInstance.dbg( LogAreaClassConnectionBOSH, "sending bosh connection request" );
      sendRequest( requestBody.xml() );
    }
  }