Android Socket.io client not connecting to Node.js server
<p>I am trying to connect an Android application to a Node.js server using socket.io.</p>

<p>This is the server source:</p>

<pre><code>'use strict';
const express = require('express');
const body = require('body-parser');

var app = express()

var freq = 500;

const PORT = process.env.PORT || 3000;
var deviceCount = 0;
app.use(express.static('untoldFront'))

app.post('/api/setfreq/:freq', function (req, res) {
    freq = req.params.freq;
    res.json({freq: freq});
});

var io = require('socket.io').listen(app.listen(PORT, function(err) {
    console.log('Express is listening on port %d.', PORT);
}));
var i = 0;

io.on('connection', function(socket) {
    deviceCount += 1;
    socket.emit('connected');
    console.log("Another phone connected. (t: %d)", deviceCount);
    socket.on('lightOn', function () {
        console.log('on');
        socket.emit('lightOn');
    });
});
</code></pre>

<p>On the app I have these:</p>

<pre><code>private Socket mSocket;
{
    try {
        mSocket = IO.socket("http://untoldflash.herokuapp.com");
    } catch(URISyntaxException e) {
        throw new RuntimeException(e);
    }
}
</code></pre>

<p>In the activity's onCreate method:</p>

<pre><code>mSocket.connect();
</code></pre>

<p>The server is not receiving any new connections. What's the problem?</p>