This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IP Address Sniffer Log

 
dashang trivedi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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.....
 
Paul Clapham
Sheriff
Pie
Posts: 20955
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Pie
Posts: 20955
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic