设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 软件追踪 查看内容

Socket.IO 1.1.0发布

2014-9-10 16:30| 发布者: joejoe0332| 查看: 1994| 评论: 0|原作者: oschina|来自: oschina

摘要: Socket.IO 1.1.0 发布,此版本包括了大量的 bug 修复和许多新插件。此版本一共有20 位贡献者。服务器hasBin no longer iterates over object prototypes (GH#1645) Enhanced font styles in the chat example app (G ...

Socket.IO 1.1.0 发布,此版本包括了大量的 bug 修复和许多新插件。此版本一共有 20 位贡献者。

服务器

  • hasBin no longer iterates over object prototypes (GH#1645) [kevin-roark]

  • Enhanced font styles in the chat example app (GH1653) [acusti]

  • Fixed etag header in server socket.io.js (GH#1655) [ysmood]

  • Fixed repo url in package.json (GH#1673) [bryanburgers]

  • Improved namespace and disconnection tests (GH) [guille]

  • Fixed possible crash on reconnect due to referencing deleted object property (GH#1682) [kevin-roark]

  • Emitting error packet when connecting to non-existing namespace (GH#1688) [fdellabetta]

  • Fixed room removal logic when leaving a room, props (GH#1697) [Marreck]

  • Faster git checkout in travis and SVG travis badge, (GH#1714, GH#1713) [PeterDaveHello]

  • No double utf8 encoding of packets on websocket transport (GH#322) [rase-]

  • Fixed binary decode memory leak (GH#27,GH#28) [christophwitzko, rase-]

  • Better utf8 error handling (GH#29) [nkzawa]

  • Fixed memory leak in websocket usage (GH, GH) [guille, nicokaiser]

  • Possibility to cleanly close the server (GH#1646) [narcisoguillen]

  • Declaring namespaces without the / prefix possible (GH#1729) [asyncanup]

  • The remoteAddress property on the connection is now cached so it should always be accessible (GH#270) [rase-]

客户端

  • Better utf8 error handling (GH#316) [nkzawa]

  • reconnect_failed event is now fired only once in socket.io-client (GH#708) [rase-]

  • autoConnect option in socket.io-client, making it possible to disable connecting without explicitly calling manager.open (GH#680, GH#728) [FredyC, nkzawa]

  • Our tests are faster and better than ever using the travis build matrix (GH, GH#335) [tootallnate, rase-, guille]

  • It is now possible to disable JSONP as a transport (GH#314) [rase-]

  • You can now use XDomainRequest to avoid loading bar flashing in IE8 (GH#331 GH#333GH#334) [yujiosaka]

这里有一些新特性的示例:

支持简洁的关闭 socket.io 服务器:

1
2
3
4
5
6
7
var app = require('http').createServer();
var io = require('socket.io')(app);
var fs = require('fs');
 
app.listen(3333, function() {
  io.close();
});

可以不用 / 前缀来声明命名空间:

1
2
3
4
5
6
7
8
9
10
11
var app = require('http').createServer();
var io = require('socket.io')(app);
 
// '' and '/' are equal
io.of('').on('connection'function(){
  // Connecting to '/' will do the trick
});
// 'abc' and '/abc' are equal
io.of('abc').on('connection'function(){
  // Connecting to '/abc' will do the trick
});

现在提供了一些自动的连接选项在 socket.io-client,不需要调用  manager.open 就能禁用连接:

1
2
3
4
var manager = io.Manager('http://localhost:9823', { autoConnect: false });
setTimeout(function(){
  manager.open(); // Won't start connecting until now
}, 500);

使用特斯拉构建矩阵后,我们的测试比之前更快更好:
build

示例代码

更多内容请看发行说明

Socket.IO旨在让各种浏览器与移动设备上实现实时app功能,模糊化各种传输机制。


酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部