anchor.diff:        if Not FConnected then begin
           exit; // Protection inside lock thread to prevent double disconnect sessions
         end;
  +      {$IFDEF DelphiSockets}
  +      Try
  +        FTcpBlockSocket.Disconnect;
  +      Finally
  +        FConnected := False;
  +      End;
  +      {$ENDIF}
  +      {$IFDEF Synapse}
         DebugStep := 'disconnecting';
         if Not FConnected then exit;
         DebugStep := 'Closing socket';
         FTcpBlockSocket.CloseSocket;
         DebugStep := 'Relasing flock';
         FConnected := false;
  +      DebugStep := 'Calling OnDisconnect';
  +      if Assigned(FOnDisconnect) then FOnDisconnect(Self)
  +      else TLog.NewLog(ltError,ClassName,'OnDisconnect is nil');
  +      {$ENDIF}
       Finally
         FLock.Release;
       End;
  -    DebugStep := 'Calling OnDisconnect';
  -    if Assigned(FOnDisconnect) then FOnDisconnect(Self)
  -    else TLog.NewLog(ltError,ClassName,'OnDisconnect is nil');
     Except
       On E:Exception do begin
         E.Message := 'Exception at TNetTcpIpClient.Discconnect step '+DebugStep+' - '+E.Message;
         Raise;
       end;
     end;
  -  {$ENDIF}
   end;
   
   procedure TNetTcpIpClient.DoOnConnect;
  
positive.code:         Disconnect;
        end;
      End;
    Finally
      FLock.Release;
    End;
    {$ENDIF}
  end;
  
  function TNetTcpIpClient.GetConnected: Boolean;
  
negative.code:         Disconnect;
        end;
      End;
      {$ENDIF}
    Finally
      FLock.Release;
    End;
    if Result>0 then FLastCommunicationTime := Now;
  end;
  
  