Unable to write data to the transport connection: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full

Mar 2, 2011 at 12:14 PM

Hi,

I´m having this error sometimes when reading email messages using Pop3Client, even in GetTotalMessageCount. Do you know why?

Many thanks in advanced.

Environment: Windows 2003 Server  - FW2.0 and FW 3.51 installed

SendBufferSize and ReceiveBufferSize: 10240000 (I think large enough)

Code:

                    using (Pop3Client cl = new Pop3Client())
                    {

                        cl.SendBufferSize = 10240000;
                        cl.ReceiveBufferSize = 10240000;
                        cl.ResponseEncoding = Encoding.GetEncoding("ISO-8859-1");
                        cl.ServerName = ConfigurationManager.AppSettings["ServidorPop3"].ToString();
                        cl.UserName = ConfigurationManager.AppSettings["UsuarioPop3Pool"].ToString();
                        cl.Password = ConfigurationManager.AppSettings["PasswordPop3Pool"].ToString();
                        cl.Ssl = false; 

                            if (cl.Authenticate())
                            {
                                long numMensajes = cl.GetTotalMessageCount();

                                for (long i = 1; i <= numMensajes; i++)
                                {
                                    Pop3Message mg = cl.GetMessage(i);
                                    // Other code not using library
                                        if (!cl.DeleteEMail(index))
                                        {
                                            LogEntry entry = new LogEntry();
                                            entry.Severity = System.Diagnostics.TraceEventType.Warning;
                                            entry.Message = "NO se ha podido borrar el mensaje con subject: " + mg.Subject;
                                            Logger.Write(entry);
                                    }
                                }

                               cl.ExecuteQuit();
                            }

                       }

Coordinator
Mar 3, 2011 at 2:55 PM

I think the BufferSize is too much big.
Please set more small size to BufferSize property and try again.

Mar 3, 2011 at 4:41 PM

Thanks for the reply.

I have just tested using the default size and I am having the same problem. Then I have used some other values (1024, 10240, 102400) and again the problem is still there.

Regards,

 jjpsegado.

Coordinator
Mar 7, 2011 at 1:53 PM

OK.
I'll investigate about this problem.
Please wait.

Coordinator
Mar 12, 2011 at 10:41 AM

I can't reproduct your bug.
I want to know more detail.
If you can,please send your entire code to
higuchihiguchihiguchi@hotmail.com

One thing I want to check is what version you use.
Older version has bug when using socket cause out of memory issue.