Hi,
I would like to connect with a private server in order to download some information and see it in a web browser. The problem is when i try to open a new socket. The program doesn´t work and start a while (problem with s = new Socket("130.233.154.182", port);). The code is the next one:
public void onClick(View v) {
// TODO Auto-generated method stub
int port=4558;
//byte [] asBytes = bundle.toByteArray();
Log.i("before Socket","Opening socket to server..");
Socket s = null;
TCPCLThread aThread = null;
try {
s = new Socket("130.233.154.182", port);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Log.i("after new socket","Socket opened");
try {
aThread = new TCPCLThread("dtn://my.fake2.dtn",s.getInputStream(), s.getOutputStream());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
BundleSenderTest test = new BundleSenderTest(aThread);
aThread.addListener(test);
BundleDumper bd = new BundleDumper();
aThread.addListener(bd);
Log.i("addListener","Started thread, added listener");
Thread t = new Thread(aThread);
t.start();
initWebView(Mywebview, Main.this);
}
};
* I have addes Internet permissions in the manifext xml.
* I have redirected the localhost because i need to pass all the traffic in the port server, using:
telnet localhost 5554
redir add tcp:4558:4558
*Finally i thought that i should use a new DNS server in order to obtaing the correct traffic. In that case i have started the emulator with http-proxy option.
emulator -http-proxy 130.233.154.182:4558
What i am doing wrong? is there anything i am forgeting?
Thanks in advance



