Possible Duplicate:
Does close ever throw an IOException?
Can someone explain to me why socket.close()
throws an IOException
in Java? I seriously can not figure out how closing a socket is any different from telling the runtime to go right ahead and clean up the resources that the socket is holding onto. Is there another way of not leaking memory and cleaning up socket resources that I don't know of?