Sha256: c61a55bafde0127e500e5bb8c93951686848b76dcd0e1ebc1d03d2e0b2fbc49b

Contents?: true

Size: 515 Bytes

Versions: 11

Compression:

Stored size: 515 Bytes

Contents

#!/usr/bin/env ruby

require 'blather'

trap(:INT) { EM.stop }
trap(:TERM) { EM.stop }
EM.run do
  Blather::Stream::Client.start(Class.new {
    attr_accessor :jid

    def post_init(stream, jid = nil)
      @stream = stream
      self.jid = jid

      @stream.send_data Blather::Stanza::Presence::Status.new
      puts "Stream started!"
    end

    def receive_data(stanza)
      @stream.send_data stanza.reply!
    end

    def unbind
      puts "Stream ended!"
    end
  }.new, 'echo@jabber.local', 'echo')
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
blather-0.4.16 examples/stream_only.rb
blather-0.4.15 examples/stream_only.rb
shingara-blather-0.4.14 examples/stream_only.rb
blather-0.4.14 examples/stream_only.rb
blather-0.4.13 examples/stream_only.rb
blather-0.4.12 examples/stream_only.rb
blather-0.4.11 examples/stream_only.rb
blather-0.4.10 examples/stream_only.rb
shingara-blather-0.4.9 examples/stream_only.rb
shingara-blather-0.4.8 examples/stream_only.rb
blather-0.4.8 examples/stream_only.rb