I have a simple Client- Server App with Android devices.
When tried connecting on Server. NOROUTETOHOST received.
TCP\IP client - EHOSTUNREACH (No route to host)
In the above discussion , Thought its between PC-ANDROID , I tried everything.
Firewall off
Machine IP used correctly - server shows 192.168.0.3
Port is checked 8080
When i tried between emulators.It worked with IP 127.0.0.1
Please provide inputs.
GIThub code links
https://github.com/navaljoshi/ServerNaval2
https://github.com/navaljoshi/ClientNaval2
Related
I'm developing an Android app that must connect to the server to retrieve some data. I've 2 devices connected on my local WIFI via a router: My development laptop (as server) and my development android phone (as client). The laptop has as IP address 192.168.41.50 and my Apache HTTP server is running on port 81.
My problem is the following:
If I run my android application to retrieve data into the server, it doesn't work, it's giving me a timeout exception:
D/OkHttp: <-- HTTP FAILED: java.net.SocketTimeoutException: failed to connect to /192.168.43.50 (port 81) after 120000ms
But the same address is working on the laptop's browser
How can I solve this problem.
Have a look at the firewall.
Switch it off for a test.
Your problem solution is simple ->
You have to allow external devices to connect your server.
If you are using Wamp Server then look at this post for your answer ->
How to enable local network users to access my WAMP sites?
If you are using Xampp Server then look at this post for your answer ->
Accessing localhost (xampp) from another computer over LAN network - how to?
Hope this solve your problem.
I have designed a webpage and run that on my browser using tomcat server http://localhost:8084/neclogin/main.jsp
I also accessed it from my android emulator it works well.
http://10.0.2.2:8084/neclogin/main.jsp it works well.
But when I tried on my real device (connected to PC via hotspot)
http://192.xxx.xxx.xxx:8084/neclogin/web/main.jsp
It shows on browser that HTTTP 404 ERROR - DESCRIPTION :requested resource is unavailable
I am confused whether my android mobile is unable to connect to localhost or can't trace the path of my main.jsp
FOR MORE DETAIL
1)windows 7
2)NETBEANS IDE WITH APACHE TOMCAT SERVER 8.03
3)**Both connected via wifi hotspot on my mobile**
4)path to my main.jsp is `C:\Users\dell\Documents\NetBeansProjects\neclogin\web\main.jsp`
5)path to my tomcat server installed is `C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.3`
i have disabled my windows and antivirus firewall
First try to access http://192.xxx.xxx.xxx:8084/neclogin/web/main.jsp from your PC to see if the IP is correct.
a) If that works and you can access it, then indeed there is a problem with the external access and the problem is somewhere in your firewall settings or alike. Potentially it doesn't let traffic through 'non-standard' ports (80,433 etc)
b) If you can't access it on your PC either using then you got the IP wrong. Try running ipconfig from the command line and see if with the IP listed there it works. ipconfig will return a bunch of different IPs you need to look for the one that starts with 192 most likely labeled as IPv4 or something like that.
It's also worth checking what the 404 message looks like. If it's tomcat's 404 page then you're almost there as you can access tomcat but not using the correct path.
I am trying to make a connection from my Android to my local machine on a wifi network. My machines wifi ip address is 10.27.27.172 and I am running my node.js server on port 7890. I can use my phones chrome browser and browse to my server and access some endpoints which return json. My problem comes when I try and use spring-android rest template. I have given INTERNET permissions to my android application but I still get a ECONNREFUSED error. Is this an android port issue? Is the firewall blocking my request. If so why can I browse to the server but not use the REST client to get the information?
I found the answer on this stackoverflow. You need to make sure you retype the I guess the eclipse editor sometimes adds in invisible characters or something. Anyways it is working now.
I am experimenting with the new VPNService API with the sample project "ToyVPN". I have not modified the source code and it compiles smoothly, but I cannot seem to get it to connect to my VPN server on ec2. It times out with the error "Got java.lang.IllegalStateException: Timed out". From the server's perspective, no packets are being received from the phone.
I am entering in the ip address of the server, 1723, and my password for server address, server port, and shared secret respectively.
I am able to connect to my vpn server using the default ubuntu vpn manager over pap authentication using the same password.
Can someone offer insights on what is going on and how I can make ToyVPN connect to my server?
What about sample server implementation from "ToyVPN" project? Why don't you use it?
It is easy to set in Linux, all steps and limitations are described in ToyVpnServer.cpp file. Certainly at first you should compile it. I compile it using GCC package:
gcc ToyVpnServer.cpp
Program file named "a.out" will be created in the same directory.
Then just run it from command line with the parameters that described in ToyVpnServer.cpp.
It is strange, that you don't see any packets on the your VPN server side. I tried to connect to my VPN server through ToyVpn just to see what will happen. Connection was failed, but there were messages in server logs, that the packets are received, but its size is too small.
Hope this will help.
I am working in android chat application.
I used SmartFox server. I am using 10.0.2.2 as server IP address and 9933 as Port.
Whenever i run this application using emulator then works fine but when i run this application in my real device then connection does not performed correctly. I think this is unable to find out IP 10.0.2.2.
I changed this IP address to 192.168.1.9 which is IP address of my system in LAN on which SmartFox server is installed.
Please suggest me what mistake i have done.
Thank you in advance.
I resolved my problem myself. I created one entry in confi/server.xml file of server.
like this:-
<serverSettings>
<socketAddresses>
<socket address="192.168.1.9" port="22" type="TCP"/>
<socket address="192.168.1.9" port="22" type="UDP"/>
</serverSettings>
</socketAddresses>
or you may add this entry using admin module of Smartfox server. This task can be done using Server configuration part.