• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IP Address Sniffer Log

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My Objective is to store the IP address of particular machine ...which machine send request to server pc....

for Example
machine A send request to machine B....so machine A should Log the Machine B Ip address....

simple old method for know ip Address of static pc or address...




This Method Is not workingbecause how can i Find the machine ip request....

Please Reply if any solution is their.....
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course that code doesn't do anything useful because it just uses hard-coded addresses.

You didn't say anything about your server, which is where you would be getting these IP addresses from. So it's rather difficult to explain how to get IP addresses from your server. But since you didn't post this in any of the forums related to web applications, let me assume that it isn't a web application. Let me also assume that you have a ServerSocket and are accepting requests from it.

In which case the accept() method returns a Socket. Which has a method to get the address to which that Socket is connected. That's the address you want.

Or if my assumptions were wrong, feel free to provide information.
 
dashang trivedi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes sir....you understand absolutely correct.........
its not any web server...its a simple machine....

Now sir Server scocket is not work here...
if i bind ServerSocket(80)...so its give me an exception...80 is already bind its http port....
so how can i accept...
i try to develop software like wireshark...
initial level i just try how to get ip address of each Request...
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see; so you don't even have a working server yet. You might want to get your server working first and then add in the simple code to get the addresses of the clients.

By the way, Wireshark isn't a server so you may be on the wrong track. Or perhaps that was just a bad example you chose.
 
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic