I always thought that a socket would close by itself when its task was completed.