((System.IO.Stream)(s)).ReadTimeout. What might be wrong?

Hello,

I have a class that writes to a MemoryStream but I am getting a
strange error:

ReadTimeout = '((System.IO.Stream)(s)).ReadTimeout' threw an exception
of type 'System.InvalidOperationException'

  base {System.SystemException} = {"Timeouts are not supported on this
stream."}

    Source = "mscorlib"

WriteTimeout = '((System.IO.Stream)(s)).WriteTimeout' threw an
exception of type 'System.InvalidOperationException'

  base {System.SystemException} = {"Timeouts are not supported on this
stream."}

    Source = "mscorlib"

Any idea why might be wrong?

I really have no idea.

Thank You,

Miguel
0
shapper
5/20/2010 3:57:20 PM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

5 Replies
19223 Views

Similar Articles

[PageSpeed] 9

On 5/20/2010 11:57 AM, shapper wrote:
> Hello,
>
> I have a class that writes to a MemoryStream but I am getting a
> strange error:
>
> ReadTimeout = '((System.IO.Stream)(s)).ReadTimeout' threw an exception
> of type 'System.InvalidOperationException'
>
>    base {System.SystemException} = {"Timeouts are not supported on this
> stream."}
>
>      Source = "mscorlib"
>
> WriteTimeout = '((System.IO.Stream)(s)).WriteTimeout' threw an
> exception of type 'System.InvalidOperationException'
>
>    base {System.SystemException} = {"Timeouts are not supported on this
> stream."}
>
>      Source = "mscorlib"
>
> Any idea why might be wrong?
>
> I really have no idea.
>
> Thank You,
>
> Miguel

I see you are posting this and at least one other question here and to 
the forums as well.

MemoryStreams don't support timeouts and it is documented that some 
streams throw an exception.  If you have a timeout on a memory stream, 
you have bigger concerns to worry about, like needing a new computer...

-- 
Mike
0
Family
5/20/2010 4:26:13 PM
"shapper" <mdmoura@gmail.com> wrote in message 
news:98424b2f-c282-437a-9191-f8afcd5434f0@o39g2000vbd.googlegroups.com...
> Hello,
>
> I have a class that writes to a MemoryStream but I am getting a
> strange error:
>
> ReadTimeout = '((System.IO.Stream)(s)).ReadTimeout' threw an exception
> of type 'System.InvalidOperationException'
>
>  base {System.SystemException} = {"Timeouts are not supported on this
> stream."}
>
>    Source = "mscorlib"
>
> WriteTimeout = '((System.IO.Stream)(s)).WriteTimeout' threw an
> exception of type 'System.InvalidOperationException'
>
>  base {System.SystemException} = {"Timeouts are not supported on this
> stream."}
>
>    Source = "mscorlib"
>
> Any idea why might be wrong?

Yes: memory will never time out, so there's no point in MemoryStream 
supporting these properties, and .NET is slapping you on the wrist for 
accessing them when you shouldn't be. 


0
Jeff
5/20/2010 4:27:52 PM
"Family Tree Mike" <FamilyTreeMike@ThisOldHouse.com> wrote in message 
news:OAhuokD%23KHA.4564@TK2MSFTNGP05.phx.gbl...

> If you have a timeout on a memory stream, you have bigger concerns to 
> worry about, like needing a new computer...

<snicker> 


0
Jeff
5/20/2010 4:31:59 PM
On May 20, 5:26=A0pm, Family Tree Mike <FamilyTreeM...@ThisOldHouse.com>
wrote:
> On 5/20/2010 11:57 AM, shapper wrote:
>
>
>
> > Hello,
>
> > I have a class that writes to a MemoryStream but I am getting a
> > strange error:
>
> > ReadTimeout =3D '((System.IO.Stream)(s)).ReadTimeout' threw an exceptio=
n
> > of type 'System.InvalidOperationException'
>
> > =A0 =A0base {System.SystemException} =3D {"Timeouts are not supported o=
n this
> > stream."}
>
> > =A0 =A0 =A0Source =3D "mscorlib"
>
> > WriteTimeout =3D '((System.IO.Stream)(s)).WriteTimeout' threw an
> > exception of type 'System.InvalidOperationException'
>
> > =A0 =A0base {System.SystemException} =3D {"Timeouts are not supported o=
n this
> > stream."}
>
> > =A0 =A0 =A0Source =3D "mscorlib"
>
> > Any idea why might be wrong?
>
> > I really have no idea.
>
> > Thank You,
>
> > Miguel
>
> I see you are posting this and at least one other question here and to
> the forums as well.
>
> MemoryStreams don't support timeouts and it is documented that some
> streams throw an exception. =A0If you have a timeout on a memory stream,
> you have bigger concerns to worry about, like needing a new computer...
>
> --
> Mike

Sorry, both questions are related to the same problem.
The first is to solve it and the second is an alternative I am trying
to use to check if it solves it.

This is driving me crazy for hours and I decided to post in the two
different forums to try to get some help.
Didn't know the forums are related ....

Should I post only in one? Which one? I just though the communities
were different ...

Sorry but it sounds strange this is a problem with my computer ...

Maybe the fact that I am using NET 4.0?

The CSVWriter class is:
http://kbcsv.codeplex.com/SourceControl/changeset/view/42031#530488

I can't find what might be the problem ...
0
shapper
5/20/2010 5:20:28 PM
On 5/20/2010 1:20 PM, shapper wrote:
> On May 20, 5:26 pm, Family Tree Mike<FamilyTreeM...@ThisOldHouse.com>
> wrote:
>> On 5/20/2010 11:57 AM, shapper wrote:
>>
>>
>>
>>> Hello,
>>
>>> I have a class that writes to a MemoryStream but I am getting a
>>> strange error:
>>
>>> ReadTimeout = '((System.IO.Stream)(s)).ReadTimeout' threw an exception
>>> of type 'System.InvalidOperationException'
>>
>>>     base {System.SystemException} = {"Timeouts are not supported on this
>>> stream."}
>>
>>>       Source = "mscorlib"
>>
>>> WriteTimeout = '((System.IO.Stream)(s)).WriteTimeout' threw an
>>> exception of type 'System.InvalidOperationException'
>>
>>>     base {System.SystemException} = {"Timeouts are not supported on this
>>> stream."}
>>
>>>       Source = "mscorlib"
>>
>>> Any idea why might be wrong?
>>
>>> I really have no idea.
>>
>>> Thank You,
>>
>>> Miguel
>>
>> I see you are posting this and at least one other question here and to
>> the forums as well.
>>
>> MemoryStreams don't support timeouts and it is documented that some
>> streams throw an exception.  If you have a timeout on a memory stream,
>> you have bigger concerns to worry about, like needing a new computer...
>>
>> --
>> Mike
>
> Sorry, both questions are related to the same problem.
> The first is to solve it and the second is an alternative I am trying
> to use to check if it solves it.
>
> This is driving me crazy for hours and I decided to post in the two
> different forums to try to get some help.
> Didn't know the forums are related ....
>
> Should I post only in one? Which one? I just though the communities
> were different ...
>
> Sorry but it sounds strange this is a problem with my computer ...
>
> Maybe the fact that I am using NET 4.0?
>
> The CSVWriter class is:
> http://kbcsv.codeplex.com/SourceControl/changeset/view/42031#530488
>
> I can't find what might be the problem ...

Find the line that the exception occurs.  This line is presumably a 
WriteTimeout or ReadTimout property on a stream being set.  If this is 
in the CSVWriter class, then the class has a bug, because it cannot work 
with MemoryStreams.  If it is your code, it is because you cannot set 
the properties.  Setting the properties throws this exception, not a 
timeout during your read/write with the memory stream.  This is because 
memory streams do not timeout.  They cannot time out.

-- 
Mike
-1
Family
5/20/2010 8:38:01 PM
Reply:

Similar Artilces:

export CRM contacts\mail address's to outlook
Is there a way that anyone knows how to AUTO export and import the contacts from MSCRM, into outlook contacts. either by using windows scheduler or some other means. I have a client that will be using CRM with ExactTarget so having the ability to send mailshots on behalf of others (like outlook). BUT not all of their users have access to CRM, they want to have some scheduler to auto export the crm mail contacts out of CRM and into a public folder contacts list. Anyone got some great ideas? cheers J -- Thanks again for all the help Hi, We are using scrib from scribesoft, who can sche...

Your account does not have access to the forums system.
Well, that certainly didn't take long. I've been kicked out of the "social" forums. Apparently, the last banner I rotated too didn't sit so well. http://vb.mvps.org/images/forumbanner3.gif Example... http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/e1b94be4-b991-4419-a274-aa3a04e617e3/#edcafc18-bb95-4f7f-b034-1ed658d6e87c Go figure... <LOL> Karl E. Peterson formulated on Thursday : > Well, that certainly didn't take long. > > I've been kicked out of the "social" forums. > > Apparently, the la...

Bank Rec void check date s/b same as GL void date
When voiding a check in the payables management module and the Void date and Posting date are changed from the original check date, Bank reconciliation should recognize that void date instead of the original check date as the voided date. Please refer to Knowledgebase Article 857704 to see how Ban Rec handles the date of a void check. If a check is voided in Payables Mgmt on a different date than the original date, and bank rec uses the original date trying to reconcile to the general ledger is a problem because the adjusted bank book balance is different than the GL balance becuase th...

video streaming in intranet , without buffering
Hi, I am trying to bulid an application in VC++ .NET in which a server will send data for video files that contains audio/Video or both. and at cient side i want the video to be played back without buffering. the communication is unicast and in a Intranet, NOT internet. plz tell me where to start and how to go about it regards ...

Live File System DVD Burn
Is it possible to burn a DVD in Live File System format? If positive what should I do? Regards Many In news:ecVrjLSCLHA.2012@TK2MSFTNGP02.phx.gbl, Gomez <gomez@automail.com> typed: > Is it possible to burn a DVD in Live File System format? > If positive what should I do? http://lmgtfy.com/?q=xp+format+dvd+"live+file+system" ...

Boot-start of system driver(s) failed to load
My event log keeps showing error 7026, The following boot-start or system start driver(s) failed to load ftsata2. Could someone please help me with this? ...

VC++ .NET 2002: How To Use the Class View's Properties window to add a message handler for the WN_KEYDOWN message
Hi all I used "The EX05c Example: Scrolling" of the book "Programming With Microsoft Visual C++ .NET Core Reference" (6th Edition) as my 3rd example of MFC exercises to catch up my VC++ .NET 2002 (VC++ 7.0) programming. I started my 'Eg05c' project in the MFC Application Wizard and followed the 1 thru 7 steps instructed in the book (pages 82-85) I believed I did the steps 1, 2 and 3 correctly: 1 - In MFC Application Wizard -Eg05c, I setthe CEg05cView to "CScrollView" 2 - I added the m_rectEllipse and m_nColor data members in Eg05cView.h by typing in "...

Ignore Zero's
Hi I have used the following to get the average value from a set of data whilst ignoring zero values within the data set. =SUM(K4:AP4)/COUNTIF(K4:AP4,">0") I would like to use the percentile command on the same set of data. Is there a way that I can use Percentile and also ignore zero values ? Many Thanks Chris Hi, with an ARRAY formula =PERCENTILE(IF(K4:AP4>0,K4:AP4),0.1) This is an array formula which must be entered by pressing CTRL+Shift+Enter 'and not just Enter. If you do it correctly then Excel will put curly brackets 'around the formu...

Exchange system manager
I have upgraded to exchange 2003 and use a email redirector on a seperate server for mobile device users to receive email. This redirector server has an older version of the exchange system manager. I nned to upgrade this to match the mapi32 profile. I have tried to use the exchange cd and install the support tools but this will only let me install tools for exchange 5.5 How do I upgrade the system manager on a win 2k server to work with win 2k3 exchange/server? Thanks for your efforts!!! When you stick in the E2K3 cd, under the component selection, under System Tools, choose R...

Alt S wont send anymore
I can't be dreaming - installed outlook 2003 about 2 weeks ago. After creating a message, I was able to just hit alt S and the message would be sent. Now, I have to hit enter after alt S. What changed? Any ideas? thanks, larry ...

Migrate edb files from a crashed system
This is my situation: Exchange 2003 is in a machine I CAN NOT start... it just crashes, but I have access to the data inside (liveCD) and I can move it to another hard disk. I need to built another Exchange machine recovering this data (edb files, primarely)... =BFWhat are the best practices? All solutions I read about relays on having access to the original server, but this is not the case. What if I install Windows and Exchange again in the same machine WITHOUT formatting? Would it be helpful or just irrelevant? Any suggestion welcome (please do not focus on recovering the first server... ...

make query from to 64 bit system
I have a application need to be compile for 64 bit system. how can i read data from vb.net 2005. hi Jennifer, On 09.12.2009 17:36, Jennifer wrote: > I have a application need to be compile for 64 bit system. how can i read > data from vb.net 2005. First of all, I don't see the point why you're asking this question in an Access newsgroups. Further more, you should really be more spefific... mfG --> stefan <-- ...

System.Web.Services.Protocols.SoapException
Has anyone tried the Samples that come with the Webservices install? Has anyone else received this error with the Samples or does anyone know what is causing it? "System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> An exception occurred that the exception subsystem was unable to log. Consult your System Administrator.\r\n at CustomerUpdate.WebServiceManager.GetAllCompanies() in C:\\Program Files\\Microsoft Dynamics\\GPWebServicesSDK\\v9\\Samples\\UpdateCustomers\\CustomerUpdate\\WebServiceManager.cs:line 108\r\n at CustomerUpdate.Custom...

How to make Bullen's FilterCriteria() data refresh real-time?
Using XL 2003 & 2000 OK, with help, I was able to utilize Steve Bullen's FilterCriteria() Function. That said, apparently the only way to refresh the data in the display cell is to re-activate the formula by pressing <ENTER> in the Fx Box. Can the display cells be made to refresh in real-time or, second best, by F9? FYI (Background Info): ************************************************************II placed this formula into cell A1: =FilterCriteria(A3) Cell A3 contains the Autofilter down-arrow for column A ************************************************************* Fu...

Undeliverable messages from System Administrator
I have Outlook 2002 setup with an Imap account and an LDAP directory server. There are two .pst files - one for the local personal folders named outlook.pst (including default Inbox, contacts, sent messages, calendar etc) and another one for the imap account named imapaccount.pst that is basically a cache of messages on the actual server. Everything seems to be working fine except when a message is sent to an invalid account in the LDAP directory. I get a message from System Administrator in the Inbox of my Personal Folders (not the Inbox of my imap account folder that I monitor) with subject ...

USB KVM's always plays 'Device Connect' sound
It appears that USB KVM's with Audio support always make Windows XP computers play the 'Device Connect' sound when you switch between computers. Does anyone know of a USB KVM with Audio that can properly emulate the USB connection to the inactive computer, so that the 'device connect' event doesn't occur when switching between computers? <prubin@equilter.com> wrote in message news:293fbb08-74eb-4b65-8807-1c43540b4c88@o10g2000yqa.googlegroups.com... > It appears that USB KVM's with Audio support always make Windows XP > computers play the &...

554 error client host rejected wrong mail relay using Exchange 2003 /w SP2
I seem to be getting this error on a few domains that I'm sending mail to. We are using Windows 2003 /w Exchange 2003 SP2. Any idea's? Is this caused by a external DNS issue on the A or PTR record? Or... In external DNS we have our email server setup as mail2.abc.com but within Exchange we have our email server setup as mail1.abc.com would this be causing the issue? The following recipient(s) could not be reached: john@abc.com on 21/04/2006 9:54 AM There was a SMTP communication problem with the recipient's email server. Please contact your system ad...

Here's another good one... (Money 2005)
Money's Online Services for my Credit Union have downloaded my auto loan as a credit card. I can't change the account type and I can't merge it with another account. Does anyone know how to link the online services with my "REAL" loan account? || Aaron ...

is Retail Management System(RMS) been used at cafeterias?
Is Ms Retail Management System been used at cafeterias? It might work in a small operation. But is it the right fit? Not in my opinion. Other software is more cafe' friendly and made for the task. If you have a small cafe, in a retail store you might consider it, if your menu does not need to print on remote kitchen printers, and your using RMS for retail. Other wise look at Dinerware perhaps or software designed for restaurants. mt "D. Reveron" <D. Reveron@discussions.microsoft.com> wrote in message news:9D79643B-B9BF-4DD2-96F2-B49D5BCFD5C7@microsoft.com... ...

code to change a form's allows?
I am wondering what the code syntax is to tweak a form's allows? Allows deletions? Allows Adds? etc I know how to do it in the right-clicked form properties manually, but I need it to be based on conditions. Reason I need this is because I have one form that all users open. Depending on their window's username, I have a security table that tells me what role I want them to have in the database. Depending on their role, some users have more rights than others on this form. I want to adjust the form to allow additions for some users, but not others. Me.AllowAdditions = Fals...

What is wrong with my audio?
Hello.. Ever since I put a fresh install of Windows XP Professional on my computer, 32 bit btw, I have not been able to get sound to come out of my speakers.. Yes, I did install the drivers from my manufacturer's website, and even installed a program called Driver checker to install all the missing drivers I needed.. But still, no sound. Headphones don't even work so I know it's not the speakers fault, it's obviously some kind of driver messing it up or something.. Anyone have any ideas? I can supply screenshots of anything, if needed. "Rylie" <Rylie@di...

IE7 Opening wrong email program
Outlook 2003 is set as my default email program and yet when I am on the web with IE7 (& Vista) when I click File/Send/Page By Email IE7 opens Windows Mail instead of Outlook, why? My addressbook is not even present in Windows Mail. -- Thanks... Bob Click the tools button in IE, the select Options and the Programs tab. There is a button near the bottom which should let you set Outlook as the default mail cient. Hope this helps, -- Thanks, John Guin OneNote Test Team http://blogs.msdn.com/johnguin "Bob Newman" wrote: > Outlook 2003 is set as my default email pr...

Chip Pearson's VB Object references
I recently distributed a 2007 workbook that contained pop up calendars courtesy of the Microsoft Office Calendar Control 2007. I foolishly assumed that when a user opened the workbook, Excel would “realise” that there was a Calendar control embedded and automatically enable the VB reference. Optimistic eh? I was looking at ways to automate the enablement of the Calendar reference object – I found this code on Chip Pearson’s site and wondered if a similar thing could be run to automatically select the Calendar control? This code enables the Microsoft Visual Basic Application Ex...

multiple filter's...
I am building a quotation spreadsheet and i would like to know if it's possible when i use the filter function can i put the info on another page or somewhere else on the same page separate from the drop box?? the reason being i have multiple catagories of info on the same row to make it visual friendly, entering the info below the drop box i don't think could work since the different filters would vary in the amount of lines. But filtering is new to me and i'm not completely familiar with it's limitations. thanks in advance. Hi have a look at: http://www.contextures.com/xladv...

CInternetSession::OpenURL don't report wrong http URL
Hi, I used OpenURL to download a binary file by http. To my surprise, even if the url is wrong, it return pfile. Is there a way to know the wrong url? Thank you My codes: try { pfile = (CInternetFile*)m_pInetSession->OpenURL(url.data(), 1, INTERNET_FLAG_TRANSFER_BINARY, "Accept: */*\r\n\r\n", -1); if (pfile) return pfile; } catch (CInternetException* pEx) { bSuccess = false; TCHAR sz[1024]; pEx->GetErrorMessage(sz, 1024); tech=sz; pEx->Delete(); } "Kelvin" <Kelvin_gl@yahoo.com.cn> wrote in message news:eSqKa2qqF...