Eljay
Eljay

Reputation: 951

Connecting to Server from mobile when public IP for both is same

I am working on a client server application where my Server is my PC.I have done port forwarding to connect to the server.I was able to connect to the server using GPRS module, but my client application needs to be run on my Android phone.I created a simple app to connect to the server from android phone.I was able to connect to Server when i tried using cellular network but when my phone was connected to Wifi i was getting

connect Refused :ECONNREFUSED

when i researched somewhat i find out that the public ip of both mobile and Server are same. Is this the reason that i am not able to connect to server from my phone while connected to WiFi.

Upvotes: 2

Views: 74

Answers (1)

Junior Bill gates
Junior Bill gates

Reputation: 1866

Yes the reason is that they have same Public IP i.e they are on same Network. Instead give the local IP of the Pc it will connect to the server.

Upvotes: 3

Related Questions