[ECOS] I lose sockets
Andrew Lunn
andrew@lunn.ch
Wed Aug 16 13:26:00 GMT 2006
On Wed, Aug 16, 2006 at 02:56:04PM +0200, Roger Arn wrote:
> Hello
>
> I'am trying to connect with tcp to my eCos application. It works a
> few times but after it, it stops working. My code to recieve the
> datas is attached.
> I have allready read the list and I saw that some people has a
> similar problem and increased the number of sockets and the number
> of file descriptor. But for me this is not a solution.
> With a debugger I found out, that I am loosing sockets, when I close
> the extrenal application (which begun to connection to the eCos
> application). It executes the methode sofree()
> (\bsd_tcpip\current\src\sys\kern\uipc_socket.c). There it tests the
> state of the socket, and in my case, the state is false and it will
> leave the sofree() without deallocating the socket.
> After the bootup of my application, the communication thread hangs
> in the accept() method of my attached file. Now the external
> application connect to my eCos application, so it allocates a
> socket and set the socket state (so->so_state) to SS_NOFDREF (This
> state is needed to dealloc the socket).
> But after that is calls the soaccept() - methode and set the
> so->so_state to false for SS_NOFDREF. So when I'am closing the
> external application now, it tryes to make sofree() but it has the
> false state and fails to deallocate it. Whats wrong here ?
is soclose being called on the socket? If so, what over bits are set
in so->so_state? soclose() needs to get to the code after the discard:
label to set the SS_NOFDREF to true in order that sofree will actually
free the socket. Is this happening and if not why?
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list