android - Use TCP in Internet -


i'am use tcp connect android phone windows 7 pc. when i'am send message phone-pc in lan system work, i`am use system in internet down because android app send me "time out". why?

// host name can either machine name, such "java.sun.com", or // textual representation of ip address string host = "10.26.144.118"; int port = 20; try {     socket socket = new socket(inetaddress.getbyname(host), port);     bufferedreader reader = new bufferedreader(                                 new inputstreamreader(socket.getinputstream()));     printwriter writer = new printwriter(socket.getoutputstream(), true);     // true auto flush     writer.println("hello world");     myview.settext("send hello world"); } catch (exception e) { system.out.println("error" + e); myview.settext("error" + e); } 

you looking port-forwarding


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -