Avoiding System Debugger message on ESocketError

February 1st, 2007 | by Hideident |

ESocketError will occur when we try to connect TClientSocket but actually the server is not active. to avoiding system debugger error message, we cannt use try…except or try…finally (like on EZeroDivide,EOverflow,EMathError), but we can make error code to 0.
example code:

procedure TForm1.Button1Click(Sender: TObject);
begin
cs.Address := ’127.0.0.1′;
cs.Port := 12345;
cs.Active := true;
end;
procedure TForm1.csError(Sender: TObject; Socket: TCustomWinSocket;
ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin
errorcode:=0;
label1.Caption := ‘error’;
end;

  1. One Response to “Avoiding System Debugger message on ESocketError”

  2. By Lt. Elliot on May 11, 2007 | Reply

    Firefox 2.0.0.3Windows XP

    thanks, it helped me =:)

Post a Comment