• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

Peer to Peer

I want a program to give me the state or information on the other computer with peer to peer connection
Please who can help me with that, do any one has a program?
Thanks
0
Nayel2
Asked:
Nayel2
1 Solution
 
Nayel2Author Commented:
I mean a sniffer program...
0
 
ImagineCommented:
Do you mean if you can reach that computer?

You can do that with indy.

Use the IdIcmpClient1 to ping to that pc like this:

[code]

procedure TForm4.Timer1Timer(Sender: TObject);
begin
  application.ProcessMessages;
  IdIcmpClient1.OnReply := IdIcmpClient1Reply;
  IdIcmpClient1.ReceiveTimeout := 25;
  IdIcmpClient1.Host := ('192.168.0.1');
  IdIcmpClient1.Ping;
end;

procedure TForm4.IdIcmpClient1Reply(ASender: TComponent;
  const AReplyStatus: TReplyStatus);
begin
  if (aReplyStatus.BytesReceived > 0) then begin
    application.ProcessMessages;
    {let the user know that the computer is availeble}
  end else begin
    application.ProcessMessages;
    {let the user know that the computer is NOT availeble}
  end
end;

[/code]
0
 
chcoCommented:
If you need more specific addressing, simply make a connection to the computer you wish to access at the port you wish to access and capture the Exception if one occurs. If none occurs you have a connection, otherwise no connection was possible..
0
 
CleanupPingCommented:
Nayel2:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now