diff --git a/file/acp/be.bastelstu.chat.nodePush/lib/server.coffee b/file/acp/be.bastelstu.chat.nodePush/lib/server.coffee index 835a398..07ad43f 100644 --- a/file/acp/be.bastelstu.chat.nodePush/lib/server.coffee +++ b/file/acp/be.bastelstu.chat.nodePush/lib/server.coffee @@ -1,8 +1,8 @@ ### # node.js Pushserver for Tims Chat. # -# @author Tim Düsterhus -# @copyright 2010-2013 Tim Düsterhus +# @author Tim D�sterhus +# @copyright 2010-2013 Tim D�sterhus # @license Creative Commons Attribution-NonCommercial-ShareAlike # @package be.bastelstu.chat # @subpackage nodePush @@ -35,9 +35,9 @@ class Server process.on 'SIGINT', @shutdown.bind @ process.on 'SIGTERM', @shutdown.bind @ - setInterval (() -> + setInterval => @socket.sockets.emit 'newMessage' - ).bind(@), 60e3 + , 60e3 initSocketIO: () -> log 'Initializing socket.io' @socket = io.listen config.port @@ -47,19 +47,18 @@ class Server @socket.set 'browser client minification', true @socket.set 'browser client gzip', true - @socket.configure 'development', (() -> + @socket.configure 'development', => @socket.set 'log level', 3 @socket.set 'browser client etag', false @socket.set 'browser client minification', false - ).bind(@) initUnixSocket: () -> log 'Initializing Unix-Socket' - socket = net.createServer ((c) -> - setTimeout (() -> + socket = net.createServer (c) => + setTimeout => @socket.sockets.emit 'newMessage' - ).bind(@), 20 + , 20 + c.end() - ).bind(@) socket.listen process.cwd() + '/../data.sock' fs.chmod process.cwd() + '/../data.sock', '777'