Results 1 to 2 of 2

Thread: Stream Problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    167

    Arrow Stream Problem

    Hi. I am sending some data over a networkstream.

    The datasize is 97

    The buffersize is 1.

    Data is a list of bytes.

    When the bytecount reaches 94 the do while loop exist itself.

    Any ideas why?


    Code:
                While Stream.CanRead
                    Do
    
                        ByteCount += Stream.Read(Buffer, 0, BufferSize)
    
                        Data.AddRange(Buffer)
    
                        If ByteCount = 94 Then
                            Console.WriteLine("BC: " & ByteCount)
                            Console.WriteLine("DS: " & DataSize)
                        End If
    
                    Loop While ByteCount < DataSize
                 End While

  2. #2
    Junior Member
    Join Date
    Aug 2009
    Location
    Australia, Melbourne
    Posts
    29

    Re: Stream Problem

    Could we see the whole code? Are you sure the DataSize variable is initialized to 97?

    And it could be completing it properly once it reaches 94 it will output those two lines then check the condition and since it is less than 97 (check DataSize variable to be sure) it will execute again but this time i would assume the byteCount is different so it wont output anything because it doesn't equal 94 therefore it wont do much except the first two lines...

    To know exactly what is wrong we need to see the full function code at least.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width