Board index » delphi » How to get IP of connecting client?

How to get IP of connecting client?


2006-09-06 05:21:29 AM
delphi24
Delphi 5
I have this Internet app that uses Datastead's TVideoGrabber. When
another instance of this software connects to the program I need to
get the IP address of the connecting machine. How can I get this IP
address?
Thanks in advance.
___
Free Project Time Tracker for Delphi Developers
www.{*word*104}matrix.com/pcdelphi.html
 
 

Re:How to get IP of connecting client?

"Michael Fullerton" <XXXX@XXXXX.COM>wrote in
message news:XXXX@XXXXX.COM...
Quote
When another instance of this software connects to the program
I need to get the IP address of the connecting machine. How
can I get this IP address?
How is it connecting to begin with? Please provide more details.
Gambit
 

Re:How to get IP of connecting client?

"Remy Lebeau \(TeamB\)" <XXXX@XXXXX.COM>writes:
Quote

"Michael Fullerton" <XXXX@XXXXX.COM>wrote in
message news:XXXX@XXXXX.COM...

>When another instance of this software connects to the program
>I need to get the IP address of the connecting machine. How
>can I get this IP address?

How is it connecting to begin with? Please provide more details.
What do you mean how is it connecting and how is that relevant anyway?
TVideoGrabber handles all of that. I don't have the source code for
TVideoGrabber. ZoneAlarm for example knows what IP is trying to
connect to what program regardless of how it is connecting.
___
Free Project Time Tracker for Delphi Developers
www.{*word*104}matrix.com/pcdelphi.html
 

Re:How to get IP of connecting client?

"Michael Fullerton" <XXXX@XXXXX.COM>wrote in
message news:XXXX@XXXXX.COM...
Quote
What do you mean how is it connecting
I mean, where exactly are you trying to obtain the IP address from in the
first place, and how are you handing inbound connections?
Quote
how is that relevant anyway?
It is very relevant. Depending on how exactly you are managing the
connections dictates what code you have to write to access the IP addresses.
Please show an actual code snippet that demonstrates what you are trying to
accomplish.
Quote
TVideoGrabber handles all of that. I don't have the source code for
TVideoGrabber.
I did not ask you for TVideoGrabber's source code. I asked for YOUR code
that is trying to use it.
Quote
ZoneAlarm for example knows what IP is trying to connect to
what program regardless of how it is connecting.
ZoneAlarm is hooked directly into the OS's socket stack and thus can detect
every socket that is active in every running process.
Gambit
 

Re:How to get IP of connecting client?

"Remy Lebeau \(TeamB\)" <XXXX@XXXXX.COM>writes:
Quote

"Michael Fullerton" <XXXX@XXXXX.COM>wrote in
message news:XXXX@XXXXX.COM...

>What do you mean how is it connecting

I mean, where exactly are you trying to obtain the IP address from in the
first place, and how are you handing inbound connections?
I don't know what you are talking about. Right now I am not actively
trying to obtain IP addresses since I don't know how. This is why I am
posting here. Again, I am not handling inbound connections,
TVideoGrabber is.
Quote
>how is that relevant anyway?

It is very relevant. Depending on how exactly you are managing the
connections dictates what code you have to write to access the IP addresses.
Please show an actual code snippet that demonstrates what you are trying to
accomplish.
How could I have a code snippet when I am asking how to do this?
Quote
>TVideoGrabber handles all of that. I don't have the source code for
>TVideoGrabber.

I did not ask you for TVideoGrabber's source code. I asked for YOUR code
that is trying to use it.
My code is _completely_ _absolutely_ 100% irrelevant to this. My code
does not handle the Internet in any way, TVideoGrabber does all that.
Understand?
Quote
>ZoneAlarm for example knows what IP is trying to connect to
>what program regardless of how it is connecting.

ZoneAlarm is hooked directly into the OS's socket stack and thus can detect
every socket that is active in every running process.
Well then, how do I hook directly into the OS's socket stack?
___
Free Project Time Tracker for Delphi Developers
www.{*word*104}matrix.com/pcdelphi.html
 

Re:How to get IP of connecting client?

"Michael Fullerton" <XXXX@XXXXX.COM>wrote in
message news:XXXX@XXXXX.COM...
Quote
I don't know what you are talking about. Right now I am not
actively trying to obtain IP addresses since I don't know how.
That is the topic of this discussion, since that is what you originally
asked for. I cannot give you details about how to accomplish that until you
provide details about how you are working with the connections in the first
place.
Quote
This is why I am posting here. Again, I am not handling
inbound connections, TVideoGrabber is.
Well, you are obviously doing SOMETHING with it. What EXACTLY are you
doing?
Quote
How could I have a code snippet when I am asking how to do this?
There is no way to answer your original question without knowing more
details about what you are doing in the first place.
Quote
My code is _completely_ _absolutely_ 100% irrelevant to this. My
code does not handle the Internet in any way, TVideoGrabber does
all that. Understand?
How exactly are you using the TVideoGrabber in the first place? It is not
irrelevant to your question, since the only way you are going to gain access
to the IP addresses is through TVideoGrabber, if it is indeed managing the
connections for you. If it does not provide access to the connections, then
you have no way to get their information.
Quote
Well then, how do I hook directly into the OS's socket stack?
You have to write your own NDIS device driver, or else use a third-party
driver.
Gambit
 

Re:How to get IP of connecting client?

Quote
>I mean, where exactly are you trying to obtain the IP address from in the
>first place, and how are you handing inbound connections?

I don't know what you are talking about. Right now I am not actively
trying to obtain IP addresses since I don't know how. This is why I am
posting here. Again, I am not handling inbound connections,
TVideoGrabber is.
If I understand what you try to say, you are writing a program which doesn't
accept itself any IP connection but need to know what is the remote IP for a
connection established from a remote computer to a program named
TVideoGrabber. Or maybe you wrote a Delphi program using the component
TVideoGrabber and that component is accepting connection and you want to
know the remote IP address for that connection ?
Contribute to the SSL Effort. Visit www.overbyte.be/eng/ssl.html
 

Re:How to get IP of connecting client?

"Francois Piette [ICS & Midware]" <XXXX@XXXXX.COM>writes:
Quote
>>I mean, where exactly are you trying to obtain the IP address from in the
>>first place, and how are you handing inbound connections?
>
>I don't know what you are talking about. Right now I am not actively
>trying to obtain IP addresses since I don't know how. This is why I am
>posting here. Again, I am not handling inbound connections,
>TVideoGrabber is.

If I understand what you try to say, you are writing a program which doesn't
accept itself any IP connection but need to know what is the remote IP for a
connection established from a remote computer to a program named
TVideoGrabber. Or maybe you wrote a Delphi program using the component
TVideoGrabber and that component is accepting connection and you want to
know the remote IP address for that connection ?
It is the latter, yes. I wrote a Delphi program using the
TVideoGrabber component and that component is accepting connections
and I want to know the remote IP address for that connection.
Quote
Contribute to the SSL Effort. Visit www.overbyte.be/eng/ssl.html
___
Free Project Time Tracker for Delphi Developers
www.{*word*104}matrix.com/pcdelphi.html
 

Re:How to get IP of connecting client?

Quote
>TVideoGrabber. Or maybe you wrote a Delphi program using the component
>TVideoGrabber and that component is accepting connection and you want to
>know the remote IP address for that connection ?

It is the latter, yes. I wrote a Delphi program using the
TVideoGrabber component and that component is accepting connections
and I want to know the remote IP address for that connection.
OK. So you have see in TVideoGrabber source code or to ask the TVideoGrabber
author to know how to get hand either directly to the IP address, or a least
to the winsock handle for the connection. Using the handle and winsock call
(getpeername) you can get the remote IP address.
Contribute to the SSL Effort. Visit www.overbyte.be/eng/ssl.html