Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

network connection in Wan network.

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am trying establish a server (my android phone) client(my computer at home) connection.
My computer is in Lan network. so i could overcome the issue of starting a connection within the Lan network.

Because of the NAT mechanism i tried to create the android mobile as a server and my computer as a client, my computer will start the connection to the android mobile.

I created the server in my mobile with ServerSocket
I found my android ip address in web like www.whatsismyip.com

It is not working. the client(my computer) can't find the server(my phone).
(I know this not recomended architecture)
What is wrong? why is it not working? why the client can't connect to the server?

Thank's
Itamar.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a mobile device as a server is not a particularly good idea, as you seem to realize. Whether it is accessible depends on the network it's on - mobile networks generally will not allow inbound connections. If it's connected via Wifi then accessibility depends on what kinds of firewalls and routers are between the client and the device.
 
Itamar Levi
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we take a look about android applications which receive notification (like mail araivel on gmail or message from WhatsUp chat)
does It means that necessarily the client (android phone) has to initiate the first connection to the server? (in order to register in the NAT tables in the router)?

If it's true. so every time the client(android phone) change to different WIFI network it has to perform a process of register all its application (which get notifications)
to their servers?

Itamar?
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applications probably don't particularly care over which network they run- that's up to the device's networking stack.

As to notifications - my guess would be that they're delivered over GSM (or CDMA) via a gateway Google has in place.
 
Whatever. Here's a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic