private void waitSockClose(Sock sock) {
        boolean loop = true;
        Timing new_timer = new Timing();
        while (loop) {
            if ((sock.getSocket() == null && sock.getIn() == null && sock.getOut() == null) || new_timer.getTime() > timeout) {
                loop = false;
            }
        }
        Assert.assertEquals(sock.getSocket(), null, "Sock socket not set to null");
        Assert.assertEquals(sock.getIn(), null, "Sock in not set to null");
        Assert.assertEquals(sock.getOut(), null, "Sock out not set to null");
    }