Giter VIP home page Giter VIP logo

Comments (13)

uwburn avatar uwburn commented on July 17, 2024 2

Submitted pull request #122.

from node-modbus-serial.

xalepo4 avatar xalepo4 commented on July 17, 2024 1

Hi, I'm using a server to simulate a modbus component and ECONNRESET happen sometimes. I don't know why, if someone can help. Thanks

from node-modbus-serial.

yaacov avatar yaacov commented on July 17, 2024 1

@checor hi, thanks for the issue, I will look into it this weekend.

p.s.
Your snippet look ok, so it's probably something with the lib. You can run the programs ( simulator and reader ) with debug, maybe you will see something you do not see now:

export DEBUG=modbus-serial
node simulator.js

from node-modbus-serial.

checor avatar checor commented on July 17, 2024 1

@yaacov Thanks for the fast reply! I will run the snippet with debugging enabled.
If I find anything, I will post the results.

from node-modbus-serial.

uwburn avatar uwburn commented on July 17, 2024

Hello,
i'm using the Modbus Server to mock a controller where i should connect, and every time i restart the client (master) application the server crashes.

I think the server should handle the socket error event that happens when the client abruptly closes the connection. Alternative, an event might be exposed to be handled by user's code.

As a workaround i'm using:
process.on('uncaughtException', function (err) { console.error(err.stack); });

Anyway, @yaacov big thumbs up for the library!

from node-modbus-serial.

yaacov avatar yaacov commented on July 17, 2024

@uwburn Thanks

p.s.
If you can make a pull request with a fix, it will be very nice, I do not find the time to fix this ...

from node-modbus-serial.

checor avatar checor commented on July 17, 2024

from node-modbus-serial.

uwburn avatar uwburn commented on July 17, 2024

@yaacov: i will try to get a grasp on it.

from node-modbus-serial.

yaacov avatar yaacov commented on July 17, 2024

Will merge once tests are green.

from node-modbus-serial.

uwburn avatar uwburn commented on July 17, 2024

On windows the linter went crazy, so i just ignored it... my bad. I tested again on linux and fixed linter complaints.

The bad side is that on Linux i could not get the ECONNRESET error to trigger on the server.
I'm spawning a child process that opens the connection to the server and then killing it: on Windows when the process is killed the socket is closed abruptly and ECONNRESET is triggered, but on Linux it doesn't happen.

I think i cannot implement a test for this, is that ok?

from node-modbus-serial.

yaacov avatar yaacov commented on July 17, 2024

I think i cannot implement a test for this, is that ok?

yes, thanks for the work ! I will try to make the test work and merge it when I do, you can try too :-).

from node-modbus-serial.

uwburn avatar uwburn commented on July 17, 2024

Ok, i later on i will update the PR. I will leave the test case for ECONNRESET commented, so the test will not fail and you can see the idea behind it.

from node-modbus-serial.

yaacov avatar yaacov commented on July 17, 2024

fixed by #122

from node-modbus-serial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.