Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Added back .createSocket() for BC. Closes #86
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Feb 17, 2012
1 parent 012b359 commit 5145300
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ Socket.prototype.close = function() {
* @api public
*/

exports.socket = function(type, options) {
exports.socket =
exports.createSocket = function(type, options) {
var sock = new Socket(type);
for (var key in options) sock[key] = options[key];
return sock;
Expand Down
4 changes: 4 additions & 0 deletions test/test.socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
var zmq = require('../')
, should = require('should');

// alias

zmq.createSocket.should.equal(zmq.socket);

// .socket

var sock = zmq.socket('req');
Expand Down

0 comments on commit 5145300

Please sign in to comment.