sockets.remove(key);
  public static Socket get_socket(Object key)  {    Socket s = (Socket) sockets.get(key);    if (s == null)      return null;    else if (s.isClosed())      {        sockets.remove(key);        return null;      }    else      {        sockets.remove(key);        try          {            // Set one minute time out that will be changed later.            s.setSoTimeout(60*1000);          }        catch (SocketException e)          {            s = null;          }        return s;      }  }