How to stop when I don't receive any data anymore?

mrdutchie

Well-known member
Joined
Jul 7, 2003
Messages
78
Location
WI, USA
I am stuck with the following

I am asking for the LIST command on the newsserver
so I will receive all the newsgroups.

I am doing this

Do
bytes = mysocket.Receive(bb, bb.Length, 0)
ListBox1.Items.Add(Encoding.ASCII.GetString(bb))
Loop While bytes > 0


but at the end it lockes up, cause its getting stuck in that loop
how can I tell it to continue with something else as soon as I dont receive data anymore?

Thanks
 
you can set your buffer big enough so you dont need a while or you can check the bytes and determine if thats all or if there is something missing..
 
Well, If I do a LIST command for all the newsgroups,
I guess I can do a Bytes(9999999) as byte I guess
But then I still cant figure out how to continue when it stops.
I know it ends with a .
Then need to figure out how to break the whole thing into 55000 lines. (amount of newsgroups)
 
Back
Top