secs4net
secs4net copied to clipboard
In some cases, the Secs server cannot connect
Describe the bug In some cases, the Secs server cannot connect。Passive/Active SecsDevice can not connect each other’.
To Reproduce Steps to reproduce the behavior:
- Start 2 Active SecsDevice and 1 Passive SecsDevice, then enable them.
- On the Passive SecsDevice ,Alternate click Enable button and Disable button at 5 seconds intervals。
- See,3 SecsDevice will Enter Hte "Connectting" State. Passive SecsDevice will never work properly 。 Expected behavior This may be cause by multithread. In file SecsGem.cs ,_startImpl may be Start many times。 Each communication error occurr will trigger function "CommunicationStateChanging(in ConnectionState newState)",then _startImpl will be started. If multiple errors occur simultaneously,multiple _startImpl threads will start。But we only have one woke socket. socket will be open and close in more than one _startImpl thread. How do we ensure that there is only one _startImpl thread running when multiple error occurs
Screenshots
Desktop (please complete the following information):
- OS: [Win 7]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
where is your host server? or simulator?
where is your host server? or simulator?
in this source code file , the DeviceWorkerService project supply the host server. you can run DeviceWorkerService and SecsDevice two project simultaneously in VS.
我也遇到这种情况,连接不上