Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to connect to WIFI with the help of java(sockets)?

 
Jitendra Kumar Jain
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Coders,

Actaully iam a new to the socket programming... I want to connect to the WIFI.. WIFI is assigning some dynamic IPS.. So my concern is how to connect to the ethernet ports and how it is assigning these ports.. Please help..
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the server have fixed address (as in , the domain name)? If yes, you could explore, http://www.dnsjava.org
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sockets are concerned with *where* to connect, not how to connect. Are you saying that you have more than one network interface, and you want to connect using a particular one? I don't think Java code can do anything about that, you'd need to set this at the routing level.

The dnsjava library -while cool in itself- can't help with that.
 
Jitendra Kumar Jain
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you guys.. But the problem is that I know the WIFI is connecting the access point on my pc.. But how would i know which port it is using ? How do i listen to that port? Or is there any library in Java that helps in finding the port the ethernet is using..
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me ask a question to get some context information: why do you want a connection? What do you want to do with that connection?
 
Jitendra Kumar Jain
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to read and write data from the ethernet ports.. how can i do this?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I'm confused. In the title you said that you want to connect through the Wifi, but now you're saying you want to connect through Ethernet? Which one is it? And *why* is it important to use one over the other? Desktop PCs (which is what I assume you're talking about) generally only let you have a single network connection anyway.
 
Jitendra Kumar Jain
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me explain you the overall requirements.. I have one WIFI network and some hardware components that connects to these wifis.. Now these devices sends the data to NIC card and also my NIC is connected to this WIFI.. SO iam confused how the ports are allocated..? and how java is connecting to these ports...
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, still not clear - those "components" talk to the Wifi or the NIC card? Through what kind of connection - TCP/IP? And what do you mean by "how the ports are allocated"?

What is the actual problem you're trying to solve?
 
Jitendra Kumar Jain
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply..

I was given an established product that communicates with WIFI.. I have a PC with WIFI enabled.. They also have their own hardware components(connected via WIFI) that communicates and pushes the data to the NIC.. Now the NIC and WIFI enabled on the same PC. So iam not clear how they communicates and which are the ports usually being used to read/write the data that the hardware components is sending.. Let me know if still it is unclear..
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A tool like Wireshark should tell you quickly what ports are being used.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic