2019-04-02 10:24:43 -04:00
|
|
|
'use strict'
|
|
|
|
|
2019-04-08 22:52:12 -04:00
|
|
|
const { Adapter } = require('interface-transport')
|
2019-04-02 10:24:43 -04:00
|
|
|
const withIs = require('class-is')
|
2019-04-08 22:52:12 -04:00
|
|
|
const TCP = require('.')
|
2019-04-02 10:24:43 -04:00
|
|
|
|
|
|
|
// Legacy adapter to old transport & connection interface
|
2019-04-08 22:52:12 -04:00
|
|
|
class TcpAdapter extends Adapter {
|
|
|
|
constructor () {
|
|
|
|
super(new TCP())
|
2019-04-02 10:24:43 -04:00
|
|
|
}
|
|
|
|
}
|
2019-04-08 22:52:12 -04:00
|
|
|
|
2019-04-02 10:24:43 -04:00
|
|
|
module.exports = withIs(TcpAdapter, {
|
|
|
|
className: 'TCP',
|
|
|
|
symbolName: '@libp2p/js-libp2p-tcp/tcp'
|
|
|
|
})
|