Get your system administrator to run lsof.
As I mentioned in
your previous post, you must close ALL file-like resources with an explicit close(). This includes sockets, database connections, pipes and so on. Since you
STILL haven't told us what your code does or shown us a reasonable sample that can replicate the symptoms you are seeing, it is
REALLY hard to speculate as to where you are not closing resources. However, since you are seeing a socket error:
I would hazard a guess that while you are closing files, you may not be closing sockets. Again, lsof is probably your best bet to detecting your problem.