Autor Beitrag
aM0xACiLLiN
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64



BeitragVerfasst: Di 15.06.04 18:26 
Hi,

da ich nun gezwungernermaßen Indy benutze (SSL.. gibts ja leider bei TClientSocket nicht), möchte ich gerne den aktiven Verbindungsversuch abbrechen.. wenn ich allerdings folgenden Code nutze, kommt immer eine Zugriffsverletzung:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure Connect;
begin
with ClientSocket do begin
 try
  Connect(5000);
 except
  ShowMessage('Exception');
 end;
end;
end;

procedure Cancel;
begin
ClientSocket.Disconnect;
end;


(Exception wird aufgerufen)

Wie kann ich das vermeiden/umgehen?

cu
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Mi 16.06.04 18:20 
bin jetzt grad in den Indys nicht so drin, aber du hast es schon ohne die Delphi-IDE ausprobiert?

Weil wenn du einfach in Delphi F9 drückst und dann in deinem Programm einen try..except block drin hast, springt der Debugger von Delphi an, sollte eine Exception aufgerufen werden. Wenn man das Programm dann aber als normale EXE mit nem Doppelklick startet, dann kommt keine Exception mehr, weil ja kein Delphi-Debugger läuft ;)



MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
aM0xACiLLiN Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64



BeitragVerfasst: Mi 16.06.04 20:24 
Hi,

wie die exception angezeigt wird is mir schnuppe (man kann die delphi-ide-exception auch deaktivieren), mir is nur wichtig dass keine kommt eigentlich..

cu
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Do 17.06.04 12:43 
ja schon, aber hast du's schonmal ausserhalb der IDE ausprobiert? da sollte eigentlich keine Exception angezeigt werden...


MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems