Connection request refused

I am trying to connect to a socket between my laptop and my Android.

I am making a laptop as a server. To establish a connection, I use the IP address of the laptop, as shown in the ipconfig figure (running Windows 7) (this address does not match the specified sites, for example "whatismyip").

Everything works fine when I connect both my laptop and Android to the same wireless router and use the address specified by ipconfig.

However, when I use my Android’s EDGE connection and access the same IP address, the socket connection request is denied. In addition, the IP address provided by whatismyip does not work with either WLAN or EDGE.

I heard that there are two IP addresses, internal and external. And I suppose the address indicated by ipconfig is an internal address. In addition, there is some procedure called port forwarding.

Can someone help me access the server through an EDGE connection? What IP should I use for this, and if I need to do port forwarding, how can I do this? Thanks.

+4
source share
1 answer

On your laptop, when you run the ipconfig command, the IP address that it displays on any interface that you connect to your router is a private address (not a routable address). The IP address shown by whatismyip is the IP address assigned to your modem. When your phone is connected to your router via Wi-Fi, you are on the same subnet as your laptop and you can create a connection. When you are on an EDGE network, you are on a different subnet, and since your laptop IP address is not routed, you cannot connect to it. On most routers, you can configure all incoming traffic for the destination port, which will be sent to your laptop. The configuration for this depends on each router, but the idea is the same. The IP address you want to redirect this traffic to is the private IP address of your laptop (the one shown by ipconfig), and the port is any port to which traffic is sent.

+2
source

All Articles