websocket stuff

This commit is contained in:
Martin Donnelly 2016-02-17 11:59:38 +00:00
parent 77b4591054
commit 864820ea34
3 changed files with 27 additions and 26 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="8a985735-5aff-47ce-a55f-2957d4f9c5f9" name="Default" comment="should render page now">
<list default="true" id="8a985735-5aff-47ce-a55f-2957d4f9c5f9" name="Default" comment="websocket stuff">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/routes/temp.js" afterPath="$PROJECT_DIR$/routes/temp.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/views/temp.ejs" afterPath="$PROJECT_DIR$/views/temp.ejs" />
@ -25,11 +25,11 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="temp.ejs" pinned="false" current-in-tab="false">
<file leaf-file-name="temp.ejs" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/views/temp.ejs">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-7.0">
<caret line="104" column="42" selection-start-line="104" selection-start-column="42" selection-end-line="104" selection-end-column="42" />
<state vertical-scroll-proportion="0.28767124">
<caret line="104" column="47" selection-start-line="104" selection-start-column="47" selection-end-line="104" selection-end-column="47" />
<folding />
</state>
</provider>
@ -45,11 +45,11 @@
</provider>
</entry>
</file>
<file leaf-file-name="temp.js" pinned="false" current-in-tab="true">
<file leaf-file-name="temp.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/routes/temp.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.5980861">
<caret line="176" column="43" selection-start-line="176" selection-start-column="43" selection-end-line="176" selection-end-column="43" />
<state vertical-scroll-proportion="-4.6842103">
<caret line="140" column="41" selection-start-line="140" selection-start-column="41" selection-end-line="140" selection-end-column="41" />
<folding />
</state>
</provider>
@ -156,8 +156,8 @@
<option value="$PROJECT_DIR$/routes/time.js" />
<option value="$PROJECT_DIR$/newapp.js" />
<option value="$PROJECT_DIR$/public/stylesheets/tables.css" />
<option value="$PROJECT_DIR$/views/temp.ejs" />
<option value="$PROJECT_DIR$/routes/temp.js" />
<option value="$PROJECT_DIR$/views/temp.ejs" />
</list>
</option>
</component>
@ -462,12 +462,6 @@
<option name="number" value="Default" />
<updated>1447021065296</updated>
</task>
<task id="LOCAL-00003" summary="debugging">
<created>1447055263421</created>
<option name="number" value="00003" />
<option name="project" value="LOCAL" />
<updated>1447055263421</updated>
</task>
<task id="LOCAL-00004" summary="closing db to persist&#10;">
<created>1447056652943</created>
<option name="number" value="00004" />
@ -756,7 +750,13 @@
<option name="project" value="LOCAL" />
<updated>1455708009465</updated>
</task>
<option name="localTasksCounter" value="52" />
<task id="LOCAL-00052" summary="websocket stuff">
<created>1455709929590</created>
<option name="number" value="00052" />
<option name="project" value="LOCAL" />
<updated>1455709929591</updated>
</task>
<option name="localTasksCounter" value="53" />
<servers />
</component>
<component name="ToolWindowManager">
@ -813,7 +813,8 @@
<MESSAGE value="modified to use events, hopefully will fix the crashing particle" />
<MESSAGE value="socket stuff" />
<MESSAGE value="should render page now" />
<option name="LAST_COMMIT_MESSAGE" value="should render page now" />
<MESSAGE value="websocket stuff" />
<option name="LAST_COMMIT_MESSAGE" value="websocket stuff" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -1210,18 +1211,18 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/views/temp.ejs">
<entry file="file://$PROJECT_DIR$/routes/temp.js">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-7.0">
<caret line="104" column="42" selection-start-line="104" selection-start-column="42" selection-end-line="104" selection-end-column="42" />
<state vertical-scroll-proportion="-4.6842103">
<caret line="140" column="41" selection-start-line="140" selection-start-column="41" selection-end-line="140" selection-end-column="41" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/routes/temp.js">
<entry file="file://$PROJECT_DIR$/views/temp.ejs">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.5980861">
<caret line="176" column="43" selection-start-line="176" selection-start-column="43" selection-end-line="176" selection-end-column="43" />
<state vertical-scroll-proportion="0.28767124">
<caret line="104" column="47" selection-start-line="104" selection-start-column="47" selection-end-line="104" selection-end-column="47" />
<folding />
</state>
</provider>

View File

@ -107,8 +107,8 @@ router.get('/all', function (req, res, next) {
temp_db.all('SELECT * from temp', function (err, rows) {
var out = [];
logger.debug(err);
logger.debug(rows);
// logger.debug(err);
// logger.debug(rows);
rows.forEach(function (row) {
logger.debug(row.date + ', ' + row.reading);
// var t = ;
@ -199,4 +199,4 @@ wsServer.on('request', function (request) {
logger.debug((new Date()) + ' Peer ' + connection.remoteAddress + ' disconnected.');
busEmitter.removeListener('sendSocket', sendSocketHandler);
});
});;;
});;;;

View File

@ -102,7 +102,7 @@
(function () {
console.log('Starting socket?');
var url = "ws://api.silvrtree.co.uk:8085";
var url = "ws://api.silvrtree.co.uk:8039";
var wsCtor = window['MozWebSocket'] ? MozWebSocket : WebSocket;
this.socket = new wsCtor(url, 'stream');