Class: Jabber::Bytestreams::IBBInitiator
- Defined in:
- lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/ibb/initiator.rb
Overview
Implementation of IBB at the initiator side
Constant Summary
Constants inherited from IBB
Jabber::Bytestreams::IBB::NS_IBB
Instance Attribute Summary collapse
-
#block_size ⇒ Object
You may set the block-size before open.
Instance Method Summary collapse
-
#open ⇒ Object
Open the stream to the peer, waits for successful result.
Methods inherited from IBB
#active?, #close, #flush, #initialize, #read, #write
Constructor Details
This class inherits a constructor from Jabber::Bytestreams::IBB
Instance Attribute Details
#block_size ⇒ Object
You may set the block-size before open
11 12 13 |
# File 'lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/ibb/initiator.rb', line 11 def block_size @block_size end |
Instance Method Details
#open ⇒ Object
Open the stream to the peer, waits for successful result
May throw ServerError
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/ibb/initiator.rb', line 18 def open iq = Iq.new(:set, @peer_jid) open = iq.add REXML::Element.new('open') open.add_namespace IBB::NS_IBB open.attributes['sid'] = @session_id open.attributes['block-size'] = @block_size.to_s @stream.send_with_id(iq) activate end |