Solved

TsocketConnection or TClientSocket  ??

Posted on 2001-07-11
1
678 Views
Last Modified: 2010-04-06
Hello,
I've developped an client/server application where the serverapp connects to a MS-SQL database. The connection is made by the TSocketConnection (Midas Tab) and using the ScktSrvr.exe.
I want to intercept the error messages like 'error reading from socket'. I understand in the TClientSocket (Internet Tab) you can write your own onerror event and catch the exceptions. So what's the real difference between those two components? Can I use the Client- and ServerSockets to connect to my database? If not how can I catch my errormessages?

Thanks,
Pascal
0
Comment
Question by:corpa
1 Comment
 
LVL 1

Accepted Solution

by:
bnemmers earned 100 total points
ID: 6273454
You will need to create a new class based on TSocketConnection

  TMySocketConnection = class(TSocketConnection)
  protected
    procedure DoError(E: Exception); override;
  end;

then override the DoError

procedure TMySocketConnection.DoError(E: Exception);
begin
  //handle error here.
  // you could call the inherited method when you
  // finish you code which just calls raise E;
end;

Bill.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now