LearnBoost/socket.io — Issue #611: Duplicate JSONP Poll setting and clearing!!
Author: nambad
Created: 2011-11-01 11:16:44+00:00
State: open

hardik@naman:/var/www/nodetest$ node app.js
info - socket.io started
Server Started
debug - served static content /socket.io.js
debug - client authorized
info - handshake authorized 20640681991796295656
debug - setting request GET /socket.io/1/websocket/20640681991796295656
debug - set heartbeat interval for client 20640681991796295656
debug - client authorized for
debug - websocket writing 1::
debug - setting request GET /socket.io/1/xhr-polling/20640681991796295656?t=1320146268187
debug - setting poll timeout
debug - discarding transport
debug - cleared heartbeat interval for client 20640681991796295656
debug - setting request GET /socket.io/1/jsonp-polling/20640681991796295656?t=1320146269189&i=0
debug - setting poll timeout
debug - discarding transport
debug - clearing poll timeout
debug - clearing poll timeout
debug - jsonppolling writing io.j[0]("8::");
debug - set close timeout for client 20640681991796295656
debug - jsonppolling closed due to exceeded duration
debug - setting request GET /socket.io/1/jsonp-polling/20640681991796295656?t=1320146289197&i=0
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client 20640681991796295656
debug - clearing poll timeout
debug - jsonppolling writing io.j[0]("8::");
debug - set close timeout for client 20640681991796295656
debug - jsonppolling closed due to exceeded duration
debug - setting request GET /socket.io/1/jsonp-polling/20640681991796295656?t=1320146309204&i=0
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client 20640681991796295656
debug - clearing poll timeout
debug - jsonppolling writing io.j[0]("8::");
debug - set close timeout for client 20640681991796295656
debug - jsonppolling closed due to exceeded duration
debug - setting request GET /socket.io/1/jsonp-polling/20640681991796295656?t=1320146329211&i=0
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client 20640681991796295656
debug - clearing poll timeout
debug - jsonppolling writing io.j[0]("8::");
debug - set close timeout for client 20640681991796295656
debug - jsonppolling closed due to exceeded duration
debug - setting request GET /socket.io/1/jsonp-polling/20640681991796295656?t=1320146349218&i=0
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client 20640681991796295656
debug - clearing poll timeout
debug - jsonppolling writing io.j[0]("8::");
debug - set close timeout for client 20640681991796295656
debug - jsonppolling closed due to exceeded duration
debug - setting request GET /socket.io/1/jsonp-polling/20640681991796295656?t=1320146369225&i=0
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client 20640681991796295656
debug - jsonppolling received data packet 5:::{"name":"adduser"}
debug - broadcasting packet
debug - clearing poll timeout
debug - jsonppolling writing io.j[0]("5:::{\"name\":\"updateusers\",\"args\":[1]}");
debug - set close timeout for client 20640681991796295656
debug - setting request GET /socket.io/1/jsonp-polling/20640681991796295656?t=1320146387273&i=0
debug - setting poll timeout
debug - clearing poll timeout

After This it performs the write operation as required. Though the code is working fine in new browsers supporting websockets, the fallback on jsonp polling is happening this way..

I am pretty new to node and socket.io..
Also after testing it with Zombie, I am getting the following error..

hardik@naman:/var/www/nodetest$ node simulate.js
Zombie: GET http://192.168.100.92:8080/index.html
Zombie: GET http://192.168.100.92:8080/index.html => 200
Zombie: GET http://192.168.100.92:8080/socket.io/socket.io.js
Zombie: GET http://192.168.100.92:8080/socket.io/socket.io.js => 200
Zombie: GET http://192.168.100.92:8080/socket.io/1/?t=1320146166188&jsonp=0
Zombie: GET http://192.168.100.92:8080/socket.io/1/?t=1320146166188&jsonp=0 => 200
Zombie: Firing timeout 1, delay: 1000
Zombie: Firing timeout 2, delay: 100
Zombie: GET http://192.168.100.92:8080/socket.io/1/jsonp-polling/1381621205521299385?t=1320146166205&i=1
Zombie: Firing timeout 4, delay: 1000
Zombie: Firing timeout 3, delay: 25000

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot call method 'appendChild' of null
at Transport.post (/socket.io/socket.io.js:3032:21)
at Transport.send (/socket.io/socket.io.js:2490:10)
at Transport.packet (/socket.io/socket.io.js:1389:10)
at Socket.packet (/socket.io/socket.io.js:1739:22)
at SocketNamespace.packet (/socket.io/socket.io.js:2052:17)
at SocketNamespace.emit (/socket.io/socket.io.js:2101:17)
at SocketNamespace. (http://192.168.100.92:8080/index.html:undefined:undefined