Error because of sockets not released

  • I'm using commoncpp in linux (Fedora Core 6) in my research project in distributed systems which makes extensive use of TCP socket connections, after a while I got this error:

    // these are my logs
    Fatal Error Could not create socket because of an error [24]
    Error description is [EMFILE] Process file table overflow
    // this is the exception generated
    Could not create socket:
    terminate called after throwing an instance of 'dsm::SockException'

    looks like sockets are not released, I explicitly call disconnect but not sure if I'm missing something in order to free the socket resources properly

    thanks for your help