We currently have this odd logic in ProtocolConnection.InvokeAsync, where when IsServer, we wait for the connect task to complete before performing the invocation. That's really a work-around for rare race condition where we accept a dispatch on an incoming connection before its connect task has completed.
Once we eliminate ProtocolConnection, we could for example await _connectTask at the beginning of _acceptRequeststTask in IceRpcProtocolConnection.
See #2241.
We currently have this odd logic in ProtocolConnection.InvokeAsync, where when IsServer, we wait for the connect task to complete before performing the invocation. That's really a work-around for rare race condition where we accept a dispatch on an incoming connection before its connect task has completed.
Once we eliminate ProtocolConnection, we could for example await _connectTask at the beginning of _acceptRequeststTask in IceRpcProtocolConnection.
See #2241.