"Queue Empty" after stream.Expect

Jan 8, 2013 at 3:15 AM

stream.Expect(new Renci.SshNet.ExpectAction("done\r\n",
                            (rS1a) =>
                            {
                                writeToLog(rS1a);
                                writeToLog(row.field.ToString() + " sent");
                            })
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)   
at System.Collections.Generic.Queue`1.Dequeue()   
at Renci.SshNet.ShellStream.Expect(TimeSpan timeout, ExpectAction[] expectActions)   
at Renci.SshNet.ShellStream.Expect(ExpectAction[] expectActions)   
at HDTestWinForm.Form1.<>c__DisplayClassf.<method>b__a(String rS1) in Form1.cs:line 287   
at Renci.SshNet.ShellStream.Expect(TimeSpan timeout, ExpectAction[] expectActions)   
at Renci.SshNet.ShellStream.Expect(ExpectAction[] expectActions)   at HDTestWinForm.Form1.method(recording row) in Form1.cs:line 283
very simple example but every time the code makes it to both writetolog methods.
The issue is just before the debug would go from the method to the end brace of rS1a an exception is thrown.
It appears to be a problem with Dequeue Method but why?
This happens sometimes 1 out of every 3 tries for my routine.  Nothing is different per try other than a filename.
Is there a way to check the Queue? I am not seeing a way to inspect this?

Coordinator
Jan 8, 2013 at 3:17 PM

Hi,

 

The Queue is an internal way for me to handle data but you should never get to this situation.

I just added could more checks to ensure this does not happen.

Please get latest source code and see if you still experience this problem.

 

Thanks,

Oleg