Hello:
    I was testing my application and and noticed in
the log that when I tried to destroy the
TWSocketThrdServer while it had opened connections, I
got a few (seemingly) random AVs which I traced to
the following lines in PutDataInSendBuffer method:

procedure TCustomWSocket.PutDataInSendBuffer(Data :
Pointer; Len : Integer);
var
  oBuffer  : TBuffer;
  cWritten : Integer;
  bMore  : Boolean;
begin
  if (Len <= 0) or (Data = nil) then
    exit;

{$IFDEF COMPILER2_UP}
  EnterCriticalSection(GSendBufCritSect);
  try
{$ENDIF}
    { vvvv THE FOLLOWING LINE vvvv }
    if FBufList.Count = 0 then begin
      oBuffer := TBuffer.Create(FBufSize);
      FBufList.Add(oBuffer);
    end
    else
      oBuffer := FBufList.Last;
    Inc(FBufferedByteCount, Len);
    bMore := TRUE;
    while bMore do begin
      cWritten := oBuffer.Write(Data, Len);
      if cWritten >= Len then
        bMore := FALSE
      else begin
        Len  := Len - cWritten;
        Data := PChar(Data) + cWritten;
        if Len < 0 then
          bMore := FALSE
        else begin
          oBuffer := TBuffer.Create(FBufSize);
          FBufList.Add(oBuffer);
        end;
      end;
    end;
    bAllSent := FALSE;
{$IFDEF COMPILER2_UP}
  finally
    LeaveCriticalSection(GSendBufCritSect);
  end;
{$ENDIF}
end;


   The full error is "[EAccessViolation] Access
violation at address 00469094 in module
'SmailQ_con.exe'. Read of address 00000008"

   Its hard for me to reproduce exactly, but has
anybody any idea what could be causing this?

   -dZ.

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to