Autor Beitrag
PeterPan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Mi 10.08.05 15:08 
hallo leute,

hab mal wieder eine frage.. :)


beim diconnect am server geht er in execute,
wie kann ich dass verhindern?


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TTcpServerClass.TcpServerExecute(AThread: TIdPeerThread);
var
  _MStream: TMemoryStream;
  _HandleMsg: THandleMsg;
  _HandleStream: THandleMsgStream;
  _iMsgType, _iTSize: integer;
begin

  // prüfen ob daten im buffer sind
  if not AThread.Connection.Socket.Readable(0then Exit;

......................


hat jemand eine idee?

thx
pp
r4id3n
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 115

Win XP Home, Win XP Pro
D6 Prof, D7 Ent, K3 Ent
BeitragVerfasst: Mi 10.08.05 15:29 
ausblenden Delphi-Quelltext
1:
if not AThread.Connected then exit;					
PeterPan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Mi 10.08.05 15:41 
hallo,

das geht aber auch nicht...

ausblenden Delphi-Quelltext
1:
if not AThread.Connected then exit;					


geht garnicht!

:!: :!:

und das

ausblenden Delphi-Quelltext
1:
if not AThread.Connection.Connected then exit;					


nutzt mir nix, er ist ja noch beim disconnect!

mal ein wenig mehr code!

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
procedure TTcpServerClass.TcpServerExecute(AThread: TIdPeerThread);
var
  _MStream: TMemoryStream;
  _HandleMsg: THandleMsg;
  _HandleStream: THandleMsgStream;
  _iMsgType, _iTSize: integer;
begin

  // prüfen ob daten im buffer sind
  if not AThread.Connection.Socket.Readable(0then Exit;

  //
  if not AThread.Connection.Connected then exit;

  // Init
  _MStream      := NIL;
  _HandleMsg    := NIL;

  try
   // lesen der grösse
   _iTSize:= AThread.Connection.ReadInteger;

   // erzeugen eines memory streams
   _MStream := TMemoryStream.Create;

   // schreiben in den memory stream (minus der ersten 4 byte)
   AThread.Connection.ReadStream(_MStream, _iTSize-4, False);

   // prüfen auf gesamtgrösse(minus der ersten 4 byte)
   if (_iTSize-4)<>(_MStream.Size) then
    HandleMsg(Self, ERROR_TOTAL_SIZE_MISS_MATCH, msgError);




ich muss wissen ob daten im buffer sind oder ob das "Execute" ereigniss aus einem andern grund erfolgt.


noch ein hinweis!
ich habe keinen einfluss auf den client!

Protokoll scheidet aus!
:? :? 8)


naja, ich wäre für vorschläge dankbar :D

thx
pp