lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] lwip_recvfrom returning ERR_CLSD


From: Prashant R
Subject: [lwip-users] lwip_recvfrom returning ERR_CLSD
Date: Tue, 1 Mar 2011 15:09:55 -0800

I am using polarSSL with libcurl to talk to lwip . 

I find that during SSL handshake with the server , I am able to send the initial "Client Hello" request . 

However the subsequent socket read operation fails in lwip_recvfrom . The read request is for 5 bytes . 

 if (err != ERR_OK) {

        if (off > 0) {

          /* update receive window */

          netconn_recved(sock->conn, (u32_t)off);

          /* already received data, return that */

          sock_set_errno(sock, 0);

          return off;

        }

        /* We should really do some error checking here. */

        LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): buf == NULL, error is \"%s\"!\n",

          s, lwip_strerr(err)));

        sock_set_errno(sock, err_to_errno(err));

        if (err == ERR_CLSD) {

          return 0;

        } else {

          return -1;

        }

      }


The situation seems to be slightly better if I do an explicit wait after the socket write operation. 

The sockets are blocking . I was wondering why the socket code would not block until data is received in the buffer ? 

Thanks 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]