Toon posts:

[delphi]socket error irritant

Pagina: 1
Acties:
  • 259 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
als ik een verbinding heb met een clientsocket en een serversocket, en de verbinding word verbroken tussen die 2...dan krijg ik van delphi zoon irritante popup van: Asyncronous socket error 10057, hoe kan ik zorgen dat ik die error niet meer te zien krijg?
if ($vraag == RTFM) { echo("ik heb google en de search al gebruikt :) "); }

  • Creepy
  • Registratie: Juni 2001
  • Laatst online: 09-09 21:25

Creepy

Tactical Espionage Splatterer

Je gebruikt toch wel het OnError event he?
Delphi help
Occurs when the socket fails in making, using, or shutting down a connection.

property OnError: TSocketErrorEvent;

Description

Write an OnError event handler to respond to errors that arise with the socket connection. Set the ErrorCode parameter to 0 if the OnError event handler successfully deals with the error condition, to prevent an ESocketError from being raised.

"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney


Verwijderd

Topicstarter
als ik in de help zoek dan kirjg ik dit:
Occurs when a reader object encounters an error reading its data, such as reading the name of an undeclared property or an illegal value.

type TReaderError = procedure(Reader: TReader; const Message: string; var Handled: Boolean) of object;
property OnError: TReaderError;

Description

OnError is used internally by the Delphi environment to report errors. It can also be used to write an event handler to selectively choose to process or ignore errors.

The last parameter passed to the OnError event handler is a var parameter called Handled. By default, the Error method passes False in Handled, but a handler that corrects the error or chooses to ignore the error can set Handled to True, which prevents further processing of the error. If the event handler returns with Handler still set to False, the reader object raises an EReadError exception.
en/of
The type for event handlers that respond when a Windows socket reports an error.

Unit

ScktComp

type

TErrorEvent = (eeGeneral, eeSend, eeReceive, eeConnect, eeDisconnect, eeAccept);

TSocketErrorEvent = procedure (Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer) of object;

Description

The Sender parameter is the socket component that encountered the error.

The Socket parameter is the TCustomWinSocket object that receives the error notification.

The ErrorCode parameter is the error code returned by the Windows socket API call. Changing this to 0 within an error handler prevents an exception from being raised.

The ErrorEvent parameter indicates what Socket was attempting to do when the error occurred. It is of type TErrorEvent, which can have any of the following values:

ValueMeaning

eeGeneral - The socket received an error message that does not fit into any of the following categories.

eeSend - An error occurred when trying to write to the socket connection.

eeReceive - An error occurred when trying to read from the socket connection.

eeConnect - A connection request that was already accepted could not be completed.

eeDisconnect - An error occurred when trying to close a connection.

eeAccept - A problem occurred when trying to accept a client connection request.
nou..het spijt me zeer maar hier begrijp ik dus echt geen reet van...kan iemand misschien beetje uitleggen? :)

  • WOmBaT
  • Registratie: September 2000
  • Laatst online: 30-11-2025

WOmBaT

Nyaaa!!!

The ErrorCode parameter is the error code returned by the Windows socket API call. Changing this to 0 within an error handler prevents an exception from being raised
:P Duidelijk toch?