If I open and close the socket by calling an instance
Socket s = new Socket( ... ); s.setReuseAddress(true); in = s.getInputStream(); ... in.close(); s.close();
Linux claims that this socket is still open, or at least a file descriptor to connect to. When requesting open files for this lsof process, there is an entry for a closed connection:
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME java 9268 user 5u sock 0,4 93417 can't identify protocol
This entry is saved until the program is closed. Is there any other way to permanently close a socket? I am a little worried that my java application might block many file descriptors. Is it possible? Or does Java support these sockets to reuse them even if ReuseAdress is installed?
java linux file-descriptor sockets
tigger
source share