socket close() -w- pthreads linux 2.6.18.2-34 (suse) SMP
Interesting issue. There was some discussion on the LKML last year regarding the potential problems in concurrent applications reusing file descriptors in various scenarios. The main issue is that the reuse of a file descriptor and reception of data in a threaded application can be confused pretty easily.
Alan Cox suggested using shutdown() before close() to deal with one of the most glaring reuse problems. This doesn't seem to work 100% either.
If I have code like this:
The reuse of file descriptors still causes EBADF in some cases. The parent process is simple in an accept() loop creating handler threads till MAXTHREADS then recycling. As you see the handler does nothing but read till error and then exits.
I'm still getting EBADF on some closes and as a result having incrementing numbers of close-wait connects.
I have written a socker program. I have executed that program many times without closing the socket. So I want to find which all sockets binded with which file descriptor.
Is there any way to close those socket, which have been opened in that program's execution.
please help me!.. (3 Replies)
Hi all,
I have a HP-UX 11.23 that have a Server establishing connections on port 8888 .
The problem is that when i need to stop and restart the Server, the connections mantain the same state and i need to wait about 20-30 minutes before all connections finishes.
The connections remain at... (2 Replies)
Hello,
I'm currently having a problem with HPUX.
The application is a C app. It's a socket server.
It runs mostly fine, but under some circumstances (I can not replicate it), the app hangs and the CPU goes to 100%.
I have use gdb to attach to the app, and it was doing a close().
the... (0 Replies)
I have a SUN environment running an WebLogic that communicates w/a 3rd party running IIS. When the IIS site goes down (frequently), I am stuck with sockets in an ESTABLISHED state, and cannot seem to figure out how to avoid this. No exceptions are thrown as I can still open connections to the IIS... (1 Reply)