Fix net module API

This commit is contained in:
Kagami Hiiragi 2015-02-06 12:47:40 +03:00
parent 376bc25912
commit 701fa33742
6 changed files with 10 additions and 10 deletions

View File

@ -80,4 +80,4 @@ BaseTransport.prototype.close = function() {
throw new Error("Not implemented");
};
exports.BaseTransport = BaseTransport;
module.exports = BaseTransport;

View File

@ -11,7 +11,7 @@ var net = require("net");
var dns = require("dns");
var assert = require("../_util").assert;
var PPromise = require("../platform").Promise;
var BaseTransport = require("./base").BaseTransport;
var BaseTransport = require("./base");
var sockIdCounter = 0;
@ -174,4 +174,4 @@ Transport.prototype.close = function() {
}
};
exports.Transport = Transport;
module.exports = Transport;

View File

@ -8,7 +8,7 @@
var inherits = require("inherits");
var assert = require("../_util").assert;
var BaseTransport = require("./base").BaseTransport;
var BaseTransport = require("./base");
/**
* WebSocket transport constructor.
@ -26,4 +26,4 @@ Transport.prototype.connect = function(opts) {
this._client = new WebSocket(opts);
};
exports.Transport = Transport;
module.exports = Transport;

View File

@ -10,7 +10,7 @@
var inherits = require("inherits");
var WebSocket = require("ws"); // jshint ignore:line
var assert = require("../_util").assert;
var BaseTransport = require("./base").BaseTransport;
var BaseTransport = require("./base");
var WebSocketServer = WebSocket.Server;
@ -35,4 +35,4 @@ Transport.prototype.listen = function(opts) {
this._server = new WebSocketServer(opts);
};
exports.Transport = Transport;
module.exports = Transport;

View File

@ -3,12 +3,12 @@ var expect = require("chai").expect;
var bitmessage = require("../lib");
var structs = bitmessage.structs;
var message = structs.message;
var WsTransport = require("../lib/net/ws").Transport;
var WsTransport = require("../lib/net/ws");
var TcpTransport, tcp;
if (!process.browser) {
TcpTransport = require("../lib/net/tcp").Transport;
TcpTransport = require("../lib/net/tcp");
describe("TCP transport", function() {
before(function(done) {

View File

@ -1,4 +1,4 @@
var TcpTransport = require("../lib/net/tcp").Transport;
var TcpTransport = require("../lib/net/tcp");
function start() {
var tcp = new TcpTransport();