lib/blather/stream.rb in blather-0.8.0 vs lib/blather/stream.rb in blather-0.8.1
- old
+ new
@@ -125,10 +125,10 @@
#
# @param [#to_xml, #to_s] stanza the stanza to send over the wire
def send(stanza)
data = stanza.respond_to?(:to_xml) ? stanza.to_xml(:save_with => Nokogiri::XML::Node::SaveOptions::AS_XML) : stanza.to_s
Blather.log "SENDING: (#{caller[1]}) #{stanza}"
- send_data data
+ EM.next_tick { send_data data }
end
# Called by EM.connect to initialize stream variables
# @private
def initialize(client, jid, pass, connect_timeout = nil)