Renci.SshNet.ShellStream.EndExpect C# (CSharp) Method

EndExpect() public method

Ends the execute.
Either the IAsyncResult object did not come from the corresponding async method on this type, or EndExecute was called multiple times with the same IAsyncResult.
public EndExpect ( IAsyncResult asyncResult ) : string
asyncResult IAsyncResult The async result.
return string
        public string EndExpect(IAsyncResult asyncResult)
        {
            var ar = asyncResult as ExpectAsyncResult;

            if (ar == null || ar.EndInvokeCalled)
                throw new ArgumentException("Either the IAsyncResult object did not come from the corresponding async method on this type, or EndExecute was called multiple times with the same IAsyncResult.");

            // Wait for operation to complete, then return result or throw exception
            return ar.EndInvoke();
        }