我试图用袖珍材料收集闪电。 io,但并不总是在幼.污染中发生。
我看不出,如果任何人能够帮助,我会错做什么。
www.un.org/spanish/ecosoc 在服务器边:
var app = express.createServer(),
io = require( socket.io ).listen(app, {
flashPolicyServer: true,
transports: [ flashsocket , htmlfile , xhr-polling , jsonp-polling ]
});
app.listen(80);
www.un.org/spanish/ecosoc 在客户方面:
...
<script src="/socket.io/socket.io.js"></script>
...
socket = io.connect();
socket.on( connect , function(evt) {
console.log(socket.socket.transport.name);
onOpen(timeDifference(new Date(), earlierDate), socket.socket.transport.name);
earlierDate = new Date();
socket.on( disconnect , function(evt) {
onClose(evt);
});
socket.on( echo , function(msg) {
onEcho(msg);
});
socket.on( error , function(evt) {
onError(evt);
});
});
After that I checked that my browser chrome has flash enabled. I also checked that port 843 and 10843 are listening and responding :
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>
在服务器记录上,只有:
debug - served static content /socket.io.js
debug - client authorized
info - handshake authorized 14328044138726156
debug - setting request GET /socket.io/1/xhr-polling/14328044138726156?t=1333755740295
debug - setting poll timeout
debug - client authorized for
debug - clearing poll timeout
debug - xhr-polling writing 1::
debug - set close timeout for client 14328044138726156
debug - setting request GET /socket.io/1/xhr-polling/14328044138726156?t=1333755740299
debug - setting poll timeout
debug - clearing poll timeout
debug - xhr-polling writing 5:::{"name":"echo","args":["transport type : xhr-polling; and socket.id : 14328044138726156"]}
debug - set close timeout for client 14328044138726156
debug - discarding transport
debug - cleared close timeout for client 14328044138726156
debug - setting request GET /socket.io/1/xhr-polling/14328044138726156?t=1333755740303
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client 14328044138726156
debug - clearing poll timeout
debug - xhr-polling writing 8::
debug - set close timeout for client 14328044138726156`
感谢你们的帮助