This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

I lose sockets


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 ?
I have waited also a few minutes but the socket will never be deallocated ? Has this a correlation to the tcp close process ? 
In the forum I found that some people changed the time for let the socket be closed, but i didn't found it. Do I have to change this time or is there an other problem too ?
 
Thx for your help !!!!!
 


Roger Arn
Développement électronique / informatique
Direct: +41 (0) 32 491 70 47
Email:roger.arn@affelec.ch

AFFOLTER TECHNOLOGIES SA
Grand Rue 76
CH-2735 Malleray

+41 (0)32 491 70 00
+41 (0)32 491 70 05 www.affelec.ch

Attachment: Application.txt
Description: Application.txt

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]