Solved

HTTP Web Response

Posted on 2013-06-19
1
253 Views
Last Modified: 2013-06-20
I have a sub that is doing a HttpWebRequest

I am getting a response...

But I need to keep the connection open and receive a continuing response stream of xml

The "XML bursts" will come though every second or so

Example
I post this
<command>
   <phoneID> 123</phoneID>
</command>

I get back initially...
<Result xsi:type="org.m5.data.v2.cti.HostedConnectObject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <csta:MonitorStartResponse>
       <csta:monitorCrossRefID>243</csta:monitorCrossRefID>
   </csta:MonitorStartResponse>
</Result>

and then in an ongoing "monitoring" I will get back every few seconds any phone call actions xml and if no calls on the phone...every 30 seconds
<Response>
   <monitoring>243</monitoring>
</Response>

My problem is that I'm getting back the initial response...and then the thread closes

How do I keep this response "stream???" open and close ONLY on response being idle for 2 minutes?
0
Comment
Question by:lrbrister
1 Comment
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
Comment Utility
use BeginGetRequestStream which uses asynchronous request.
check example here:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetrequeststream.aspx
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now