Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions dist/stomp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions src/stomp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Byte =
# NULL byte (octet 0)
NULL: '\x00'

MAX_FRAME_SIZE = 16*1024

# ##[STOMP Frame](http://stomp.github.com/stomp-specification-1.1.html#STOMP_Frames) Class
class Frame
# Frame constructor
Expand Down Expand Up @@ -117,7 +119,12 @@ class Client
_transmit: (command, headers, body) ->
out = Frame.marshall(command, headers, body)
@debug? ">>> " + out
@ws.send(out)
while(true)
if out.length > MAX_FRAME_SIZE
@ws.send(out.substring(0, MAX_FRAME_SIZE))
out = out.substring(MAX_FRAME_SIZE)
else
return @ws.send(out)

_setupHeartbeat: (headers) ->
return unless headers.version in [Stomp.VERSIONS.V1_1, Stomp.VERSIONS.V1_2]
Expand Down Expand Up @@ -355,4 +362,4 @@ else if exports?
Stomp.WebSocketClass = require('./test/server.mock.js').StompServerMock
# or in the current object (e.g. a WebWorker)
else
self.Stomp = Stomp
self.Stomp = Stomp