public void setUseSocketTimeout(boolean use_socket_timeout) throws SocketException {
        if (this.use_socket_timeout && !use_socket_timeout) {
            socket.getSocket().setSoTimeout(0);
        } else if (!this.use_socket_timeout && use_socket_timeout) {
            socket.getSocket().setSoTimeout(getSocketTimeout());
        }
        this.use_socket_timeout = use_socket_timeout;
    }