Sha256: 89f1f0475c1e778fa6cc737d9cdbe793a38062853b6adc8c68a7591e9481e430

Contents?: true

Size: 534 Bytes

Versions: 37

Compression:

Stored size: 534 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
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

37 entries across 37 versions & 2 rubygems

Version Path
blather-2.0.0 examples/stream_only.rb
blather-1.2.0 examples/stream_only.rb
blather-1.1.4 examples/stream_only.rb
blather-1.1.3 examples/stream_only.rb
blather-1.1.2 examples/stream_only.rb
blather-1.1.1 examples/stream_only.rb
blather-1.1.0 examples/stream_only.rb
blather-1.0.0 examples/stream_only.rb
blather-0.8.8 examples/stream_only.rb
blather-0.8.7 examples/stream_only.rb
blather-0.8.6 examples/stream_only.rb
blather-0.8.5 examples/stream_only.rb
blather-0.8.4 examples/stream_only.rb
blather-0.8.3 examples/stream_only.rb
blather-0.8.2 examples/stream_only.rb
tp-blather-0.8.5 examples/stream_only.rb
tp-blather-0.8.4 examples/stream_only.rb
tp-blather-0.8.3 examples/stream_only.rb
tp-blather-0.8.2 examples/stream_only.rb
blather-0.8.1 examples/stream_only.rb