allow options to be passed into createSocket
This commit is contained in:
parent
298101c5df
commit
7423850bf6
|
@ -6,10 +6,9 @@
|
||||||
|
|
||||||
var UdpSocket = require('./UdpSocket');
|
var UdpSocket = require('./UdpSocket');
|
||||||
|
|
||||||
exports.createSocket = function(type) {
|
exports.createSocket = function(options) {
|
||||||
return new UdpSocket({
|
if (typeof options === 'string') options = { type: options }
|
||||||
type: type
|
return new UdpSocket(options)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.Socket = UdpSocket;
|
exports.Socket = UdpSocket;
|
||||||
|
|
Loading…
Reference in New Issue