imap: “Unable to create selectable TCP socket” when sending email from a C++ program

北战南征 提交于 2019-12-20 06:57:56

问题


I am trying to send an email from a C++ program using imap library. I have a Google Apps and a Gmail account to which I am sending the email.

Whenever the program fails to send an email I am logging the errors to a file.

I set my program to run in loop to send the emails. Sometimes, I don't get the emails and when I checked the log file I found out these errors being logged every time sending the email fails.

Here is the part of the log file:

[2012-04-23 11:04:34]   ErrCode:1 ErrMsg:Unable to create selectable TCP socket (2753 >= 1024)
[2012-04-23 11:04:34]   ErrCode:2 ErrMsg:Unable to create selectable TCP socket (2753 >= 1024)
[2012-04-23 11:05:36]   ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1692 >= 1024)
[2012-04-23 11:05:36]   ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1692 >= 1024)
[2012-04-23 11:07:52]   ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1605 >= 1024)
[2012-04-23 11:07:52]   ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1605 >= 1024)
[2012-04-23 11:08:02]   ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1566 >= 1024)
[2012-04-23 11:08:02]   ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1566 >= 1024)
[2012-04-23 11:08:09]   ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1067 >= 1024)
[2012-04-23 11:08:09]   ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1067 >= 1024)
[2012-04-23 11:08:19]   ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1648 >= 1024)
[2012-04-23 11:08:19]   ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1648 >= 1024)
[2012-04-23 11:08:20]   ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1130 >= 1024)
[2012-04-23 11:08:20]   ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1130 >= 1024)

Is it related to imap server port? If so, which port should it be set to? 993 always?? How to troubleshoot this error?

Here are my setting:

Name: Ashwin
my email: blahblah@wyswtf.com
reply-to-email: blahblah@wyswtf.com

SMTP server information:

Host: smtp.gmail.com
Encryption: SSL
Port: 465

The program runs as root user and the library that I am using is from http://panda.com/imap/


回答1:


The library uses some ancient I/O multiplexing code and as a result it can only handle 1,024 connections at a time. Either use a different library or rate-limit your requests to the library.

Update: I was going to research this for you and, if necessary, fix the code to work around this or figure out changes to how you build the code. But it seems the library is not publicly available. Sorry, we can't fix closed source code for you.



来源:https://stackoverflow.com/questions/10310712/imap-unable-to-create-selectable-tcp-socket-when-sending-email-from-a-c-pro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!