You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If Open is called on a netTcp connection (unsure about other types) then if a ServiceContract method is invoked AFTER the open time has expired then the socket will have been closed.
This appears to be due the BeginWriteCore method in SocketConnection.cs starting an timer for asynchronous send operations. The EndWrite method does not cancel the _sendTimer which expires and closes the socket.
Calling a method sends synchronously which calls SetWriteTimeout with synchronous set to true. SetWriteTimeout then clears the _sendTimer by cancelling it.
I believe this is new as the calls to System.Net.NegotiateStream is now async (comparing to the reference source code)
To Reproduce
Add and run the test in this commit (I used Binding.Tcp.IntegrationTests) peteri@cd6d1f1
Apologies for the "hacky" nature of this as I can't build the current master so tested on the release/2.1.0 branch and the Thread.Sleep.
Expected behavior
Calling Open does not abort the connection.
The text was updated successfully, but these errors were encountered:
peteri
changed the title
Call Open on ICommunication leaves async timer running which closes socket.
Calling Open on ICommunication leaves async timer running which closes socket.
Sep 10, 2019
Describe the bug
If Open is called on a netTcp connection (unsure about other types) then if a ServiceContract method is invoked AFTER the open time has expired then the socket will have been closed.
This appears to be due the BeginWriteCore method in SocketConnection.cs starting an timer for asynchronous send operations. The EndWrite method does not cancel the _sendTimer which expires and closes the socket.
Calling a method sends synchronously which calls SetWriteTimeout with synchronous set to true. SetWriteTimeout then clears the _sendTimer by cancelling it.
I believe this is new as the calls to System.Net.NegotiateStream is now async (comparing to the reference source code)
To Reproduce
Add and run the test in this commit (I used Binding.Tcp.IntegrationTests)
peteri@cd6d1f1
Apologies for the "hacky" nature of this as I can't build the current master so tested on the release/2.1.0 branch and the Thread.Sleep.
Expected behavior
Calling Open does not abort the connection.
The text was updated successfully, but these errors were encountered: