Re: Socket connection return "Process file table overflow."
- From: David Schwartz <davids@xxxxxxxxxxxxx>
- Date: Tue, 25 Mar 2008 07:41:17 -0700 (PDT)
On Mar 25, 4:06 am, Nuno <nuno.escul...@xxxxxxxxx> wrote:
1) I can't perform two sequential downloads with the same open
socket, the SSL_write and SSL_read functions fail in the second
download.
What version of HTTP did you implement?
2) Because of the first problem, before i download any file i perform
a reconnect action (close the connection and open again everything),
but the problem is that when i try to download several files (300 for
example), sequentially, in the 20s or 30s i have the following error
"Process file table overflow." when i try to create the socket. And
only after waiting a while (five ten minutes) is when i can download
any other file without restarting the process.
There's probably a bug in your program, perhaps you're not closing
connections properly.
I' think that my problem to both problems is cleaning process, i do
not close or is missing some cleanup operations on my socket... but i
can't seem to figure what is?!
For example to connect i perform the following actions:
//open the socket
m_nSocketFD = socket(PF_INET, SOCK_STREAM, 0); /*is here that the
"Process file table overflow." is given*/
bzero(&sAddr, sizeof(sAddr));
sAddr.sin_family = AF_INET;
sAddr.sin_port = htons(n_port);
sAddr.sin_addr.s_addr = *(long*)(psHost->h_addr);
connect(m_nSocketFD, (struct sockaddr*)&sAddr, sizeof(sAddr));
//open the ssl connection
m_psSSLctx = InitCTX();
m_psSSL = SSL_new(m_psSSLctx); /* create new SSL connection state
*/
SSL_set_connect_state(m_psSSL);
SSL_set_fd(m_psSSL, m_nSocketFD); /* attach the socket descriptor
*/
SSL_set_mode(m_psSSL,SSL_MODE_AUTO_RETRY);
SSL_connect(m_psSSL);
To close connections i perform the following actions (i think it's
here that is missing something but i don't know what?!?)
X509_free(m_pcX509Cert);
SSL_shutdown(m_psSSL);
SSL_free(m_psSSL);
SSL_CTX_free(m_psSSLctx);
close(m_nSocketFD);/* close socket */
Why are you freeing the context?
DS
.
- Follow-Ups:
- References:
- Prev by Date: Re: Creating fragmentation using sockets (on ethernet)
- Next by Date: Re: Socket connection return "Process file table overflow."
- Previous by thread: Socket connection return "Process file table overflow."
- Next by thread: Re: Socket connection return "Process file table overflow."
- Index(es):
Relevant Pages
|