package com.fabiano04apps.remotympc.tasks;

import android.os.AsyncTask;
import android.util.Log;

import com.fabiano04apps.remotympc.classes.Connection;

import org.jsoup.nodes.Document;

import java.io.IOException;
import java.net.SocketTimeoutException;

/**
 * Created by Fabiano on 08/11/2016.
 */

public class VariablesTask extends AsyncTask<Object, Void, Document> {
    @Override
    protected Document doInBackground(Object... params) {
        Document doc = null;
        try {
            Connection conn = (Connection) params[0];
            doc = conn.getStatus();
        } catch (SocketTimeoutException ste) {
            Log.d("CONN", "Server timeout. Media Classic Player is probably closed");
            // return "Server timeout";
        } catch (IOException e){
            // return "Url not valid";
        } catch (Exception e){
            return null;
        }
        return doc;
    }
}
