Skip to content

Commit

Permalink
fix some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jmesnil committed Sep 25, 2013
1 parent 215de48 commit 863f1db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
20 changes: 8 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# * Copyright (C) 2013 [Jeff Mesnil](http://jmesnil.net/)
#
# The library can be used in node.js app to connect to STOMP brokers over TCP
# or Web sockets.

###
Stomp Over WebSocket http://www.jmesnil.net/stomp-websocket/doc/ | Apache License V2.0

Copyright (C) 2013 [Jeff Mesnil](http://jmesnil.net/)
###

# Root of the `stompjs module`
// Copyright (C) 2013 [Jeff Mesnil](http://jmesnil.net/)
//
// Stomp Over WebSocket http://www.jmesnil.net/stomp-websocket/doc/ | Apache License V2.0
//
// The library can be used in node.js app to connect to STOMP brokers over TCP
// or Web sockets.

// Root of the `stompjs module`

var Stomp = require('./lib/stomp.js');
var StompNode = require('./lib/stomp-node.js');
Expand Down
22 changes: 11 additions & 11 deletions src/stomp-node.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# * Copyright (C) 2013 [Jeff Mesnil](http://jmesnil.net/)
#
# The library can be used in node.js app to connect to STOMP brokers over TCP
# The library can be used in node.js app to connect to STOMP brokers over TCP
# or Web sockets.

###
Expand All @@ -12,17 +12,17 @@
Stomp = require('./stomp')
net = require('net')

# in node.js apps, `setInterval` and `clearInterval` methods used to handle
# in node.js apps, `setInterval` and `clearInterval` methods used to handle
# hear-beats are implemented using node.js Timers
Stomp.Stomp.setInterval = (interval, f) ->
setInterval f, interval
setInterval f, interval
Stomp.Stomp.clearInterval = (id) ->
clearInterval id
clearInterval id

# wrap a TCP socket (provided by node.js's net module) in a "Web Socket"-like
# wrap a TCP socket (provided by node.js's net module) in a "Web Socket"-like
# object
wrapTCP= (port, host) ->
wrapTCP = (port, host) ->

# the raw TCP socket
socket = null

Expand All @@ -44,10 +44,10 @@ wrapTCP= (port, host) ->

return ws

# wrap a Web Socket connection (provided by the websocket npm module) in a "Web
# wrap a Web Socket connection (provided by the websocket npm module) in a "Web
# Socket"-like object
wrapWS= (url) ->
wrapWS = (url) ->

WebSocketClient = require('websocket').client

# the underlying connection that will be wrapped
Expand All @@ -59,7 +59,7 @@ wrapWS= (url) ->
send: (d) -> connection.sendUTF(d)
close: ->connection.close()
}

socket = new WebSocketClient()
socket.on 'connect', (conn) ->
connection = conn
Expand Down

0 comments on commit 863f1db

Please sign in to comment.