Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

TsocketConnection or TClientSocket  ??

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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