'test+++', '6666', { options:
{ uri: 'mqtt://broker.hivemq.com:1883',
clientId: 'my-client-id',
username: 'your-username',
password: 'your-password',
protocol: 'ws',
defaultProtocol: 'ws',
keepalive: 60,
reschedulePings: true,
protocolId: 'MQTT',
protocolVersion: 4,
reconnectPeriod: 1000,
connectTimeout: 30000,
clean: true,
resubscribe: true,
customHandleAcks: [Function],
hostname: 'localhost',
port: 80,
path: '/',
wsOptions: { objectMode: false } },
streamBuilder: [Function: wrapper],
outgoingStore: { options: { clean: true }, _inflights: {} },
incomingStore: { options: { clean: true }, _inflights: {} },
queueQoSZero: true,
_resubscribeTopics: {},
messageIdToTopic: {},
pingTimer: null,
connected: false,
disconnecting: false,
queue: [],
connackTimer: 9913,
reconnectTimer: null,
_storeProcessing: false,
_packetIdsDuringStoreProcessing: {},
nextId: 28955,
outgoing: {},
_firstConnection: true,
_events:
{ close: [ [Function], [Function], [Function] ],
connect: [Function] },
_eventsCount: 2,
_maxListeners: undefined,
stream:
{ _readableState:
{ objectMode: false,
highWaterMark: 16384,
buffer: { head: null, tail: null, length: 0 },
length: 0,
pipes:
{ _writableState:
{ objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree: { next: null, entry: null, finish: [Function] } },
writable: true,
_write: [Function],
_callbacks:
{ unpipe: [ [Function: onunpipe] ],
drain: [ [Function] ],
error: [ [Function: onerror] ],
close: [ { [Function: on] fn: [Function: onclose] } ],
finish: [ { [Function: on] fn: [Function: onfinish] } ] } },
pipesCount: 1,
flowing: true,
ended: false,
endEmitted: false,
reading: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
_writableState:
{ objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 56,
writing: true,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function],
writecb: [Function: nop],
writelen: 1,
bufferedRequest:
{ chunk: { '0': 54 },
encoding: 'buffer',
isBuf: true,
callback: [Function: nop],
next:
{ chunk: { '0': 0, '1': 4 },
encoding: 'buffer',
isBuf: true,
callback: [Function: nop],
next:
{ chunk: { '0': 77, '1': 81, '2': 84, '3': 84 },
encoding: 'buffer',
isBuf: true,这次里面有没有connect方法?