Permalink
Browse files

fix some formatting

  • Loading branch information...
jmesnil committed Sep 25, 2013
1 parent 215de48 commit 863f1dbec6578e467e9fbc047e4e0686979960da
Showing with 19 additions and 23 deletions.
  1. +8 −12 index.js
  2. +11 −11 src/stomp-node.coffee
View
@@ -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');
View
@@ -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.
###
@@ -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
@@ -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
@@ -59,7 +59,7 @@ wrapWS= (url) ->
send: (d) -> connection.sendUTF(d)
close: ->connection.close()
}
-
+
socket = new WebSocketClient()
socket.on 'connect', (conn) ->
connection = conn

0 comments on commit 863f1db

Please sign in to comment.