Comments (10)
Thanks,
I will look into it and see if I can find out what's going on.
from s22.imap.
Thank you!
OOM could be thrown by another reason for sure, but it was thrown on
GetResponse method of ImapClient
on the following line:
mem.WriteByte(b);
Thanks,
Victor
On Wed, Nov 28, 2012 at 5:30 PM, smiley22 [email protected] wrote:
Thanks,
I will look into it and see if I can find out what's going on.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-10797645.
from s22.imap.
I've found it. At some point server closes connection and an exception is thrown from GetResponse.
It starts cycling infinitely (hitting GetResponse method upto 6K times per second).
while (true) {
try {
string response = GetResponse();
/* A request was made to stop idling so quit the thread */
if (response.Contains("OK IDLE"))
return;
/* Let the dispatcher thread take care of the IDLE notification so we
* can go back to receiving responses */
idleEvents.Enqueue(response);
} catch (IOException) {
/* Closing _Stream or the underlying _Connection instance will
* cause a WSACancelBlockingCall exception on a blocking socket.
* This is not an error so just let it pass.
*/
}
}
from s22.imap.
Ah okay so that's what it is, good job! I'll try to come up with a fix asap.
cheers,
smiley22
On Thu, Nov 29, 2012 at 5:15 AM, vchernyshev [email protected]:
I've found it. At some point server closes connection and an exception is
thrown from GetResponse.
It starts cycling infinitely (hitting GetResponse method upto 6K times per
second).while (true) {
try {
string response = GetResponse();
/* A request was made to stop idling so quit the thread /
if (response.Contains("OK IDLE"))
return;
/ Let the dispatcher thread take care of the IDLE notification so we
* can go back to receiving responses /
idleEvents.Enqueue(response);
} catch (IOException) {
/ Closing _Stream or the underlying _Connection instance will
* cause a WSACancelBlockingCall exception on a blocking socket.
* This is not an error so just let it pass.
*/
}
}—
Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-10834503.
from s22.imap.
There's not much you can do when the server closes the connection, I guess it's best to just let the exception bubble up in this case. This is a pretty delicate part of the library and I want to make sure the changes are really bullet-proof, so feel free to give some feedback.
while (true) {
try {
string response = GetResponse();
/* A request was made to stop idling so quit the thread */
if (response.Contains("OK IDLE"))
return;
/* Let the dispatcher thread take care of the IDLE notification so we
* can go back to receiving responses */
idleEvents.Enqueue(response);
} catch (IOException e) {
/* Closing _Stream or the underlying _Connection instance will
* cause a WSACancelBlockingCall exception on a blocking socket.
* This is not an error so just let it pass.
*/
if (e.InnerException is SocketException) {
/* WSAEINTR = 10004 */
if (((SocketException)e.InnerException).ErrorCode == 10004)
return;
}
/* If the IO exception was raised because of an underlying
* ThreadAbortException, we can ignore it. */
if (e.InnerException is ThreadAbortException)
return;
/* Otherwise let it bubble up */
throw;
}
}
from s22.imap.
Thank you for the fix. One question though. What is best place to catch this bubbled exception?
from s22.imap.
Hello! I'm still getting OutOfMemory Exception on
private string GetResponse(bool resolveLiterals = true)
...
in mem.WriteByte(b);
from s22.imap.
okay thanks, will take another look at it
from s22.imap.
I have also seen an out of memory error in the GetResponse method.
The set-up when the error happens is that the call to the ImapClient constructor passed in useSSL = false and a port number of 993. The hostname was set to "outlook.office365.com". Fixing the useSSL to be true stopped the error.
Hope this helps.
from s22.imap.
I guess it'd be better to catch the exception in IdleLoop and raise some sort of error event..
from s22.imap.
Related Issues (20)
- Error “xm007 bad command argument 11” while marking outlook email as read from Scheduler not at manual run
- How can check the status of Message if is seen or unseen
- Attachments from iPhones don't always populate the Attachments collection HOT 2
- SearchCondition.SentSince seems not working HOT 1
- Low file size attachment is not found
- No type "Mailmessage" in Mono C# .net core linux application HOT 1
- Where are attachments after downloading ?
- Network connection lost while retrieving a mail message HOT 1
- SCRAM-SHA-1-PLUS + SCRAM-SHA-224(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-384(-PLUS) + SCRAM-SHA-512(-PLUS) + SCRAM-SHA3-512(-PLUS) supports
- Move this project to new dev team?
- inline file
- Intermittent freezing on Search
- DeleteMessage doesn't delete the message
- Documentation is not available - 404 error HOT 1
- xm002 NO SELECT Unsafe Login. Please contact [email protected] for help HOT 1
- Can not login to gmail HOT 1
- Connection doesn't restart after disruption to internet connection
- How to read email with 'Reply-To' position email account
- Is there a save option for the message itself as a *.eml file
- Error getting value from 'ReadTimeout' on 'System.IO.MemoryStream'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s22.imap.