node-tftp icon indicating copy to clipboard operation
node-tftp copied to clipboard

TypeError: Cannot read property 'send' of null

Open koooge opened this issue 6 years ago • 0 comments

Hi there. Is this npm still maintened? I encountered an error when I try to put a file onto my created server using tftp.

test code (server)

const tftp = require('tftp');

const server = tftp.createServer({port: 61234}, (req, res) => {
	req.on('error', err => {
		console.log(err);
	});
});
server.listen();

test command

$ ./node_modules/.bin/ntftp put aaa.txt tftp://localhost:61234/remote-hoge.txt
/private/tmp/hoge/node_modules/tftp/lib/protocol/request.js:118###########] 100%
	this._socket.send (buffer, 0, buffer.length, this._port, this._address, cb);
	             ^

TypeError: Cannot read property 'send' of null
    at fn.Request._send (/private/tmp/hoge/node_modules/tftp/lib/protocol/request.js:118:15)
    at fn.Request.abort (/private/tmp/hoge/node_modules/tftp/lib/protocol/request.js:37:7)
    at module.exports.<anonymous> (/private/tmp/hoge/node_modules/tftp/lib/streams/client/put-stream.js:55:34)
    at emitTwo (events.js:131:20)
    at module.exports.emit (events.js:214:7)
    at ReadStream.Readable.unpipe (_stream_readable.js:735:12)
    at unpipe (_stream_readable.js:684:9)
    at module.exports.onclose (_stream_readable.js:672:5)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)

koooge avatar Sep 06 '18 07:09 koooge