net-module does't react when pulling of the cable (embedded Linux)

16 views
Skip to first unread message

Sokrates Embaye

unread,
Aug 9, 2016, 10:59:34 AM8/9/16
to nodejs
Hallo everyone,

i have a problem that I want to discuss.
I'm using the npm module nodes7 to communicate with a Siemens-PLC, an industrial computer for automating processes. NodeS7 uses the net-module to create a socket for the whole communication.

Now the problem:
I'm reading cyclic values from the plc. To simulate a connection error I pulled off the Ethernet cable. I tested the reaction of my software on three OS. Windows, Ubuntu VM and the destination system an embedded Linux OS. Each of them behave different. The Windows-OS and Ubuntu VM are stopping the communication which is good. In the emb. Linux nothing happens. I debugged the net module to see what's happening in it.

The following picture shows the log-files of each OS.
left shell=Windows: after a Timeout of the nodeS7-library the net-module detects an ECONNRESET
middle shell=Ubuntu: after a Timeout of the nodeS7-library the net-module detects an EOF
right shell=embedded Linux: nothing is getting detected




When you have a look on the src-code of the net-module you can see that the debug-log onread is getting created within the onread-function. The on-read function is always called whenever the handle gets a buffer, or when there's an error reading.

Well, I have a reading error. What I am doing wrong???
Any ideas?


Auto Generated Inline Image 1
Reply all
Reply to author
Forward
0 new messages