Hello, Bishop!
B> Dim output As String
B> streamReader = New System.IO.StreamReader(networkStream)
B> Do While streamReader.Peek > 0
B> If output <> "" Then output = output & vbCrLf
B> output = output & streamReader.ReadLine
B> Loop
B> Return output
I suggest, that you use Network stream directly. Here's sample in C#
byte[] data = new byte[1024];
int count;
output = string.Empty;
while ( (count = networkStream.Read(data, 0, data.Length)) != 0 )
{
output += Encoding.ASCII.GetString(data, 0, count);
//another code here
}
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Bishop - 27 Sep 2006 22:53 GMT
When I do it that way, the function returns empty strings.
So there is no way to set a timeout?
> Hello, Bishop!
>
[quoted text clipped - 24 lines]
> Regards, Vadym Stetsyak
> www: http://vadmyst.blogspot.com
Carl Daniel [VC++ MVP] - 27 Sep 2006 23:47 GMT
> When I do it that way, the function returns empty strings.
>
> So there is no way to set a timeout?
NetworkStream.ReadTimeout and .WriteTimeout let you set the timeout of the
stream. Having set the timeout (the default in Infinite), your stream
reader should throw an IOException when the timeout occurs.
-cd
Bishop - 28 Sep 2006 01:35 GMT
Works great, Thanks!
>> When I do it that way, the function returns empty strings.
>>
[quoted text clipped - 5 lines]
>
> -cd