Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Complex thread and STreamResponse.CanRead

Posted on 2013-06-27
2
Medium Priority
?
423 Views
Last Modified: 2013-06-27
I have a While statement that starts separate threads in code.
Anywhere from 5 to 10 threads

In each thread I have a HttpWebResponse and GetResponseStream with the stream left in an OPEN state with the canread (See code below)

I need to have some way of determining if a particular stream closes...OR the thread closes or fails. (Terminology???)


So inside sub 1
Dim th As New Thread(AddressOf startPhoneMonitoring)
th.Start(sendRow)

Open in new window


And inside the startPhoneMonitoring sub
' The response object of 'HttpWebRequest' is assigned to a 'HttpWebResponse' variable. 
Using myHttpWebResponse As HttpWebResponse = CType(sendWebRequest.GetResponse(), HttpWebResponse)

     ' Displaying the contents of the page to the consoleor sending to web service/sql proc 
     Using streamResponse As Stream = myHttpWebResponse.GetResponseStream()

          'Next Line tricks into staying in Response Stream Loop
          While streamResponse.CanRead
                 etc...

Open in new window

0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 39281408
For thread, you can start another thread which keeps monitoring the ThreadState of all of these worker threads.

Not sure about the http connection though.
0
 

Author Closing Comment

by:lrbrister
ID: 39281419
CodeCruiser.

Thanks. I'll do a little grunt work and get that in place.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question