anchor.diff:      WORD);
   begin
     
  +end;
  +
  +procedure TDiocpCustomContext.PostCloseRequest;
  +begin
  +  // ߳Ͷ
  +  self.Owner.IocpEngine.PostRequest(FCloseRequest);
   end;
   
   procedure TDiocpCustomContext.postNextSendRequest;
  
positive.code:   FSendRequestLink.Free;
    FContextLocker.Free;
    FDebugStrings.Free;
    inherited Destroy;
  end;
  
  function TDiocpCustomContext.DecReferenceCounter(pvDebugInfo: string; pvObj:
      TObject): Integer;
  begin
    DoCtxStateLock({$IFDEF DIOCP_DEBUG}'DecReferenceCounter'{$ENDIF});
    try
      Dec(FReferenceCounter);
      Result := FReferenceCounter;
      {$IFDEF DIOCP_DEBUG}
      if Length(pvDebugInfo) > 0 then
        AddDebugStrings(Format('-(%d):%d,%s', [FReferenceCounter, IntPtr(pvObj), pvDebugInfo]));
      {$ENDIF}
    finally
       DoCtxStateUnLock;
    end;
      
    CheckCloseContext();
  end;
  
  procedure TDiocpCustomContext.DecReferenceCounterAndRequestDisconnect(
      pvDebugInfo: string; pvObj: TObject);
  begin
  {$IFDEF DIOCP_DEBUG}
    FOwner.logMessage('(%d)ϿϢ*:%s', [SocketHandle, pvDebugInfo],
        'RequestDisconnect');
  {$ENDIF}
    DoCtxStateLock({$IFDEF DIOCP_DEBUG}'DecReferenceCounterAndRequestDisconnect'{$ENDIF});
    try
      Dec(FReferenceCounter);
      if not FRequestDisconnect then
      begin
        FDisconnectedReason := pvDebugInfo;
        FRequestDisconnect := True;
      end;
      {$IFDEF DIOCP_DEBUG}
      if Length(pvDebugInfo) > 0 then
        AddDebugStrings(Format('-(%d):%d,DecReferenceCounterAndRequestDisconnect:%s', [FReferenceCounter, IntPtr(pvObj), pvDebugInfo]));
      {$ENDIF}
    finally
       DoCtxStateUnLock;
    end;
    
    CheckCloseContext;
  end;
  
  procedure TDiocpCustomContext.DoCleanUp;
  
negative.code: 
  function TDiocpCustomContext.IncReferenceCounter(pvDebugInfo: string; pvObj:
      TObject): Boolean;
  var
    r:Integer;
  begin
     Assert(Self<> nil);
     if FReferenceCounter < 0 then
     begin
       Result := false;
       Exit;
     end;
  
     r := AtomicIncrement(self.FReferenceCounter);
     if r > 0 then
     begin
       Result := True;
     end else
     begin
       // һ㲻ᵽ
       AtomicDecrement(self.FReferenceCounter);
     end;
  
  
  
  //  DoCtxStateLock({$IFDEF DIOCP_DEBUG}'IncReferenceCounter:' + pvDebugInfo{$ENDIF});
  //  try
  //    if (not Active) or (FRequestDisconnect) then
  //    begin
  //      Result := false;
  //    end else
  //    begin
  //      Inc(FReferenceCounter);
  //      {$IFDEF DIOCP_DEBUG}
  //      if Length(pvDebugInfo) > 0 then
  //        AddDebugStrings(Format('+(%d):%d,%s', [FReferenceCounter, IntPtr(pvObj), pvDebugInfo]));
  //      {$ENDIF}
  //
  //      Result := true;
  //    end;
  //  finally
  //    DoCtxStateUnLock;
  //  end;
  
  end;
  
  