Solved

TsocketConnection or TClientSocket  ??

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Intraweb download file link ? 1 167
find a node in VST 2 78
How to load 2 images in same column in Delphi 2 67
Sending files from  idTcpServer Socket to idTcpClient 2 52
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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 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