Results 1 to 3 of 3

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

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2003
    Posts
    58

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

    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 it's getting stuck in that loop
    how can I tell it to continue with something else as soon as I don't receive data anymore?

    Thanks

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I think you can use the Available property of the socket to see if there is any data left in the network buffer for reading.

    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/cpref/html/frlrfsystemnetsocketssocketclassavailabletopic.htm
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2003
    Posts
    58
    Thanks, will see if I can make this work for VB.NET, since there was no example for it.

    Thanks

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