This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

TCP socket communication with wired internet (not WLAN)  RSS feed

 
Ranch Hand
Posts: 52
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a rather basic question regarding TCP socket communication.

I have an android app (client) which communicates with server on PC (or laptop) via TCP sockets.

When I run this set-up with WLAN, it works fine. But when I try to run the same thing with wired internet, the android app doesn't work. It will not even install on the phone. I get this diagnostic info in Eclipse LogCat: java.net.SocketException: Address family not supported.

So does TCP socket communication work only on wireless network?

Thanks for the time.

Cheers,
Madhu
 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "wired internet"? How is the phone connected to the desktop machine, and how did you enable internet connectivity?
 
Madhu Nandan
Ranch Hand
Posts: 52
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:What do you mean by "wired internet"? How is the phone connected to the desktop machine, and how did you enable internet connectivity?



By wired internet I mean plug in a internet cable, not wifi.

And I have installed the android app on the phone by connecting phone USB cable. If the internet is wifi, I can run the the server-client setup properly. If the internet is not wifi, then I cannot even install the app on the phone (and obviously cannot run the server-client setup); I get the message as shown in the previous post in LogCat of Eclipse.

Hope I have given a better picture of the situation.

Madhu
 
Ulf Dittmer
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

By wired internet I mean plug in a internet cable, not wifi.


That provides connectivity to the desktop machine, not to the device. How are you providing internet connectivity to the device? Or am I to understand that the "internet cable" actually plugs into the device? That sounds unlikely.

If the internet is not wifi, then I cannot even install the app on the phone (and obviously cannot run the server-client setup)


Installing apps happens over USB cable; it is completely independent of any internet connectivity.

If by "If the internet is not wifi" you mean that the device is not connected via WLAN, then it should still have connectivity over the air (assuming that it is a phone, and that your phone plan includes data, but if you have an Android phone it probably does). Obviously, it would not be able to connect to anything on your local WLAN.
 
Madhu Nandan
Ranch Hand
Posts: 52
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:

By wired internet I mean plug in a internet cable, not wifi.


That provides connectivity to the desktop machine, not to the device. How are you providing internet connectivity to the device? Or am I to understand that the "internet cable" actually plugs into the device? That sounds unlikely.

If the internet is not wifi, then I cannot even install the app on the phone (and obviously cannot run the server-client setup)


Installing apps happens over USB cable; it is completely independent of any internet connectivity.

If by "If the internet is not wifi" you mean that the device is not connected via WLAN, then it should still have connectivity over the air (assuming that it is a phone, and that your phone plan includes data, but if you have an Android phone it probably does). Obviously, it would not be able to connect to anything on your local WLAN.



I think I was quite stupid and did not understand the situation properly myself.

When I used wifi, I had internet for both PC (or laptop) and phone. When I tried with wired internet (without wifi), I had internet only for PC and not for phone (no data plan as well). So obviously the client in the phone cannot connect to the server in the PC in this case.

Thank you for your time and efforts (rather apologise for this not so intelligent question ;-)

Madhu
 
Bras cause cancer. And tiny ads:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!