Created an initial attempt at fixing the source of the bug.  This code fixes things, but the Read(0) is resetting the connection more often than it should be.