lib/xmpp2s/connection.rb
# Send start stream to new connection.
Send start stream to new connection.
Send start stream to new connection .
def start_stream
      @start_stream_xmpp ||= Xmpp2s::Protocol::StartStream.new(@jid.domain)
      send_data(@start_stream_xmpp)
      response = read_data(append: '</stream:stream>')
      unless (@features = response.xpath('//stream:features').first)
        close
        fail ProtocolError, 'Expected features not found!'
      end
      @features = @features.to_s
    end
def start_stream @start_stream_xmpp ||= Xmpp2s :: Protocol :: StartStream . new ( @jid . domain ) send_data ( @start_stream_xmpp ) response = read_data ( append : '</stream:stream>' ) unless ( @features = response . xpath ( '//stream:features' ) . first ) close fail ProtocolError , 'Expected features not found!' end @features = @features . to_s end
Send start stream to new connection.
Send start stream to new connection .
# Start stream init # Start pre-authorization server handshake # Read data # Check features # Close connection # Fail with protocol error! # Convert features to string