Re: Socket connection return "Process file table overflow."



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
.



Relevant Pages

  • Re: Big Problem..help please
    ... You need to create a network connection, using details supplied by your ISP ... What is shown in Device Manager? ... connection) connection is missing, and some others stuff. ... Then i asked him if he could tell me what programs i will need to download ...
    (microsoft.public.windowsxp.help_and_support)
  • Socket connection return "Process file table overflow."
    ... I can't perform two sequential downloads with the same open ... Because of the first problem, before i download any file i perform ... a reconnect action (close the connection and open again everything), ... when i try to create the socket. ...
    (comp.os.linux.development.system)
  • Socket connection return "Process file table overflow."
    ... I can't perform two sequential downloads with the same open ... Because of the first problem, before i download any file i perform ... a reconnect action (close the connection and open again everything), ... when i try to create the socket. ...
    (comp.os.linux.development.apps)
  • Re: PocketPC hangs
    ... Hey! ... myself for missing it. ... Not sure if I would want to download to download to ... many headers on this connection though. ...
    (microsoft.public.pocketpc)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #3]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... kernel socket family. ... presentation side is left to the client. ... Each connection goes to a particular "service". ...
    (Linux-Kernel)