Solved

How to test if client is dropped (tcp/ip)

Posted on 2002-03-07
2
156 Views
Last Modified: 2010-04-05
Should tcp/ip connection notice automaticly if client drops out when the computers network cable got detached or dialup-internet connection was lost.
  My server should be able to test these hanging dead connections, because when the user reconnects it's username is already used in a hanging dead connection.
  Is there a call in tcp/ip routines that could verify working connection without changing client or server by adding a ping routine.
  I'm using Francois Piette's tcp/ip component (http://overbyte.alexid.fr/frame_index.html) in delphi 1.2

Regards
  Olmy
0
Comment
Question by:olmy
  • 2
2 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
ID: 6849481
hi
as far as im aware you will have to ping to check
as tcp/ip is only a protocol i dont see how its going to know when connection is dropped.pinging is always the safest way to check.
same as for testing if internet connection exists.
if you can use wininet in d1 then something like this could help:

procedure TForm1.Button1Click(Sender: TObject);
var
   dwConnectionTypes: dWord;
begin
dwConnectionTypes := 0;
if InternetGetConnectedState(@dwConnectionTypes, 0) then
  showmessage('connected')
 else
  showmessage('not connected');
end;

check teh sources of some of he online components,maybe one of them works in d1 or you can use sources ofit.
www.torry.net may have something useful.
Regards Barry
0
 
LVL 17

Expert Comment

by:inthe
ID: 6849486
when i say online componenst ,i mean caus ei got a componet called tonline thtas can tell if im onine or not by using ras api,it checks if a dialup connection has been made or not but it says for d2 and up so doubt it works on d1
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question