fbarresi / Sharp7

Nuget package for Sharp7
MIT License
208 stars 73 forks source link

S7Client.Connected is always true after connection #4

Closed somapatrik closed 5 years ago

somapatrik commented 5 years ago

Tested with S7-300. After successful connection to PLC, if you disconnect it or turn it off the S7Client.Connected property stays always true.

fbarresi commented 5 years ago

Hi! Thank you for reporting this issue!

This connection property comes directly from System.Net.Sockets.Socket object and it is not notification based.

Look at this Stackoverflow thread for an explaination.

For such a case we realized Sharp7Reactive that also gives you such a notification in form of anIObservable<ConnectionStates> .