[ECOS] RE : [ECOS] I lose sockets

Roger Arn roger.arn@affelec.ch
Wed Aug 16 14:17:00 GMT 2006


> 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?


Yes, soclose is being called. And at the label discard: it sets the
SS_NOFDREF. But this is done for an other socket. It works like that:

With 
hmiParameter->IPsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
It allocates a socket (s1). Then the application hangs in the accept()
method until an external application connect to my application. At this
moment it allocates a second socket (s2). Now I close the external
application and my application calls the soclose() which deallocats s1
in the manner you told me before. But s2 has never been allocated and is
lost. In my opinion, s2 has to be deallocated when I'am closing the
external application (before calling the close()), because it tryes to
do it. But this socket (s2) has a wrong state and fails in the sofree()
methode. For s2 it never calls the methode soclose(). Soclose() is
called from my application code and works fine. But here, s2 was created
automatically in the accept() methode when an external application
connects. So it should deallocate automatically too when the connection
stops, right ?



Roger Arn
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Application_close.txt
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20060816/e1071633/attachment.txt>
-------------- next part --------------
-- 
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