Giter VIP home page Giter VIP logo

quote-stream's People

Contributors

nodesocket avatar stantoncbradley avatar wbyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quote-stream's Issues

Issues getting started

I am trying to run it on my local machine for a try-out. The code seems pretty straightforward, so I ran node server.js in command line. Then tried to access localhost:4000/ It returns "Cannot GET /" Am I trying it wrong?

ticker is getting set to favicon.ico

For me, in Google Chrome at least, when I try to use the app the ticker var first gets set to AAPL, but then it gets set to favicon.ico. I would recommend changing '/:ticker' to something like '/symbol/:ticker' or using a traditional parameter like '?symbol=AAPL' and the code will work properly again.

error 141

working fine with less then 15 connection
after 15 connection server stop with error events.js on 141

var PORT = 4000;
var FETCH_INTERVAL = 300;
var PRETTY_PRINT_JSON = true;

///
// START OF APPLICATION
///
var express = require('express');
var http = require('http');
var io = require('socket.io');

var app = express();
var server = http.createServer(app);
var io = io.listen(server);
io.set('log level', 1);

server.listen(PORT);

app.get('/', function(req, res) {
res.sendfile(__dirname + '/index.html');
});

io.sockets.on('connection', function(socket) {
socket.on('ticker', function(ticker) {
track_ticker(socket, ticker);
});
});

function track_ticker(socket, ticker) {
//Run the first time immediately
get_quote(socket, ticker);
//Every N seconds
var timer = setInterval(function() {
get_quote(socket, ticker)
}, FETCH_INTERVAL);
socket.on('disconnect', function () {
clearInterval(timer);
});
}

function get_quote(p_socket, p_ticker) {

http.get({
    //host: 'www.google.com',
    host: 'localhost',
    port: 80,
    //path: '/webapp/info?client=ig&q=' + p_ticker
    path: '/webapp/user/bhavjson.php?check=0&Ses_id=' + p_ticker
}, function(response) {
    response.setEncoding('utf8');
    var data = "";

    response.on('data', function(chunk) {
        data += chunk;
    });

    response.on('end', function() {

        p_socket.emit('quote',data);

    });
});

}

Connection refused after ~2 min

After about 2 min of connectivity to the server, the express app is dumped with this exception:

Error: connect ETIMEDOUT 172.217.6.4:443
    at Object.exports._errnoException (util.js:837:11)
    at exports._exceptionWithHostPort (util.js:860:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)

Do you think this could be Google dropping the connection?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.