1

I am trying to etablish a connection to a monero mining pool. I know that the mining pools using the stratum protocol. But the only thing I receive is a connection timeout if I try to create a socket:

try{
    InetAddress address = InetAddress.getByName("pool.supportxmr.com");
    Log.d("miner","Attempting to connect to " + address.toString() + " on port " + port + ".");

    Socket  socket = new Socket(address, 3333);
    Log.d("miner", "Connection success");
}catch (IOException e){
    e.printStackTrace();
}

SupportXmr is just an example. Its not working with any pool. What am I doing wrong?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Ef Ge
  • 788
  • 1
  • 9
  • 26

1 Answers1

0

Try with port 80. Make sure you wrote INTERNET permission to AndroidManifest and use AsnycTask.

private class AsyncExec extends AsyncTask<Void,Void,Void>{


    @Override
    protected Void doInBackground(Void... voids) {
        int port=80;
        try
        {
            InetAddress address = InetAddress.getByName("pool.supportxmr.com");
            Log.d("miner","Attempting to connect to " + address.toString() + " on port " + port + ".");

            Socket socket = new Socket(address, 3333);
            Log.d("miner", "Connection success");
        }
        catch (IOException e)
        {
            e.printStackTrace();

        }
        return null;
    }
}
  • Also don't forget to call new AsyncExec().execute().
Tamir Abutbul
  • 7,301
  • 7
  • 25
  • 53
twenk11k
  • 557
  • 5
  • 17