lib/onstomp/connections/stomp_1_0.rb in onstomp-1.0.0pre1 vs lib/onstomp/connections/stomp_1_0.rb in onstomp-1.0.0
- old
+ new
@@ -12,9 +12,17 @@
# serializer
def initialize socket, client
super
@serializer = OnStomp::Connections::Serializers::Stomp_1_0.new
end
+
+ # Creates a SUBSCRIBE frame. Sets +ack+ header to 'auto' unless it is
+ # already set to 'client'.
+ # @return [OnStomp::Components::Frame] SUBSCRIBE frame
+ def subscribe_frame d, h
+ h[:ack] = 'auto' unless h[:ack] == 'client'
+ create_frame 'SUBSCRIBE', [{:id => OnStomp.next_serial}, h, {:destination => d}]
+ end
# Creates an ACK frame
# @return [OnStomp::Components::Frame] ACK frame
def ack_frame *args
headers = args.last.is_a?(Hash) ? args.pop : {}