-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
I'm trying to send a file via the client.put function to a server which I created with the tftp.createServer function. The server is set to allow put requests and saves the file in a directory. So far, everything is working, the file is present at the server and the size seems to be fine.
However, after sending the file, the client always get's a timeout [Error: Timed out] and I can't find any event which allows me to end the helper connection / see if the transfer was successful.
Any ideas? Thank you in advance! :)
Client:
var client = tftp.createClient ({ port: PORT });
client.put(local,function(error) {
console.log('cb');
if (error) console.error (error);
});
Server:
var server = tftp.createServer({
host: HOST,
port: PORT,
root: rootDir,
denyGET: true
});
server.on ("request", function (req, res){
console.log(req.file);
req.on ("error", function (error){
console.error ("[" + req.stats.remoteAddress + ":" + req.stats.remotePort +
"] (" + req.file + ") " + error.message);
});
req.on('end',function(){
console.log('req.close()');
req.close();
});
});
server.on('close',function(){
console.log('closed');
});
server.on ("listening", function(){
console.log('listening');
});
server.listen();
Metadata
Metadata
Assignees
Labels
No labels