473,587 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to find the length of a network stream which does not support

I have a network stream which I got from HttpWebResponse and does not support
seeking, How do I find the length of the network stream?

HttpWebResponse * response = dynamic_cast<Ht tpWebResponse*>
(request->GetResponse()) ;

// Gets the stream associated with the response.
Stream* receiveStream = response->GetResponseStr eam();

int n = receiveStream->Read(responseA rray, 0, responseString->Length);

----------------------------

not supported
Jul 21 '05 #1
2 3558
Sorry. Correct some typos.
-----------------------------------
I have a network stream which I got from HttpWebResponse and does not support
seeking, How do I find the length of the network stream?

HttpWebResponse * response = dynamic_cast<Ht tpWebResponse*>
(request->GetResponse()) ;

// Gets the stream associated with the response.
Stream* receiveStream = response->GetResponseStr eam();

int n = receiveStream->Read(responseA rray, 0, receiveStream->Length);

-----------------------------
not supported
Jul 21 '05 #2
Kueishiong Tu <Ku**********@d iscussions.micr osoft.com> wrote:
Sorry. Correct some typos.
-----------------------------------
I have a network stream which I got from HttpWebResponse and does not support
seeking, How do I find the length of the network stream?

HttpWebResponse * response = dynamic_cast<Ht tpWebResponse*>
(request->GetResponse()) ;

// Gets the stream associated with the response.
Stream* receiveStream = response->GetResponseStr eam();

int n = receiveStream->Read(responseA rray, 0, receiveStream->Length);

-----------------------------
not supported


Well, you could use response.Conten tLength - or you could just read the
whole stream (see http://www.pobox.com/~skeet/csharp/readbinary.html)
and then you'll know the length.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1817
by: Madestro | last post by:
Hi guys, I am making a small program to retrieve e-mails from POP accounts. I got all the e-mail parsing stuff figured out, but I cannot seem to come up with a way to find out which e-mails are NEW so I don't have to retrieve them all. If you have experience with this kind of thing, you know that the server creates unique IDs for all the...
31
4986
by: RS | last post by:
Hi, Looking to see if the following construct is valid: typedef struct { int foo; char bar; } foobar; Basically, the idea is to have the structure above point to a message buffer that has a 4-byte integer followed by a stream of variable
7
3136
by: simonrigby_uk | last post by:
Hi all, Sorry if this is the incorrect group but I couldn't see anything directly relevant. Can someone confirm for me what happens when two network streams are sent to an application at the same time. My scenario is a small server application that listens on a particular TCP port. I am sending streams of data to it via a client app....
2
1105
by: Kueishiong Tu | last post by:
I have a network stream which I got from HttpWebResponse and does not support seeking, How do I find the length of the network stream? HttpWebResponse* response = dynamic_cast<HttpWebResponse*> (request->GetResponse()); // Gets the stream associated with the response. Stream* receiveStream = response->GetResponseStream(); int n =...
3
1186
by: Tim Marsden | last post by:
Hi, I would like to redirect my browser to a Network file (not on the Web Server), whrn a button is clicked. For example a Excel workbook. I would like options to open it in Excel, in the Browser or download it to my local Machine. I am using VB.NET and ASP.NET
3
2326
by: A.M-SG | last post by:
Hi, I have a ASP.NET aspx file that needs to pass large images from a network storage to client browser. The requirement is that users cannot have access to the network share. The aspx file must be the only method that users receive image files.
2
334
by: Kueishiong Tu | last post by:
I have a network stream which I got from HttpWebResponse and does not support seeking, How do I find the length of the network stream? HttpWebResponse* response = dynamic_cast<HttpWebResponse*> (request->GetResponse()); // Gets the stream associated with the response. Stream* receiveStream = response->GetResponseStream(); int n =...
22
4006
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to receive 5 bytes buffer , I call the BeginReceive and then wait on AsyncWaitHandle.WaitOne() but it is signald imidiatly , and the next call to...
7
4672
by: =?Utf-8?B?Um9iIFRob21zb24=?= | last post by:
Hi is there a way in asp.net 1.1 to in code behind query the page size that is generated, I realise IIS does it as it has that data in the logs, I would like to capture this data so that I can create a log for performance on our site that is all held in the database TIA
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.