Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

TCP component

I want to control internet connection. I have read that I can control it by TCP.localip property. How  can I get TCP component for this.
  • 2
1 Solution

Please be more specific on what you want to do rather than saying "control internet connection".

Do you want to be able to disconnect from the internet/network?

Do you want to obtain the local IP Address? (which is what localip is for, nothing else).

eldarmusayevAuthor Commented:
Program must send data to our office over internet when text file is changed. Program must know if internet is open or closed (Internet can be delivered over network or diulup). If closed it tries to use the modem. How can it know?  
To send data from one place or the other you can use the TClientSocket and TServerSocket components that come with Delphi.

To detect whether a file has changed or not simply place a timer somewhere and do CRC checks at every interval, if the 'new' CRC value differs from the 'old' one, the file has changed so you should send it over to the server.

You can detect whether the internet is up and running by sending out a PING (ICMP echo request) to a host you can rely on being online, if it returns you have a working internet connection so you can do whatever you want to do that needs the internet.

If it's not opened you can use some delphi code to do a dialup (RAS components aplenty, try torry.ru)..

that pretty much answers it

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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