Solved

TsocketConnection or TClientSocket  ??

Posted on 2001-07-11
1
679 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 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

19 Experts available now in Live!

Get 1:1 Help Now