Componentes.Terceros.RemObj.../internal/5.0.23.613/1/RemObjects SDK for Delphi/Source/uROLocalChannel.pas
david 2824855ea7 - Modificación del paquete RemObjects_Core_D10 para que sea un paquete de runtime/designtime (antes era designtime sólo)
- Recompilación en Delphi10 de todos los paquetes de RO para generar las DCU's en Lib\D10
- Recompilación en Delphi10 de todos los paquetes de DA para generar las DCU's en Lib\D10

git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@9 b6239004-a887-0f4b-9937-50029ccdca16
2007-09-10 14:06:19 +00:00

95 lines
2.9 KiB
ObjectPascal

unit uROLocalChannel;
{----------------------------------------------------------------------------}
{ RemObjects SDK Library - Core components }
{ }
{ compiler: Delphi 5 and up, Kylix 2 and up }
{ platform: Win32, Linux }
{ }
{ (c)opyright RemObjects Software. all rights reserved. }
{ }
{ Using this code requires a valid license of the RemObjects SDK }
{ which can be obtained at http://www.remobjects.com. }
{----------------------------------------------------------------------------}
{$I RemObjects.inc}
interface
uses
{$IFDEF REMOBJECTS_TRIAL}uROTrial,{$ENDIF}
Classes, uROClient, uROClientIntf, uROLocalServer;
type
TROLocalChannel = class(TROTransportChannel)
private
fServerChannel: TROLocalServer;
protected
function GetTransportObject: TObject; override;
procedure IntDispatch(aRequest: TStream; aResponse: TStream); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public
procedure CheckProperties; override;
constructor Create(aOwner : TComponent); override;
published
property ServerLocators;
property DispatchOptions;
property ServerChannel: TROLocalServer read fServerChannel write fServerChannel;
property OnLoginNeeded;
property OnSendStream;
property OnReceiveStream;
end;
implementation
uses
uROClasses;
{ TROLocalChannel }
procedure TROLocalChannel.CheckProperties;
begin
inherited;
Check(ServerChannel = nil, Name + '.ServerChannel must be assigned.');
ServerChannel.CheckProperties;
end;
constructor TROLocalChannel.Create(aOwner: TComponent);
begin
inherited;
ThreadSafe := true;
end;
function TROLocalChannel.GetTransportObject: TObject;
begin
Result := self;
end;
procedure TROLocalChannel.IntDispatch(aRequest, aResponse: TStream);
begin
CheckProperties;
{$IFDEF DESIGNTIME}
{$IFDEF MSWINDOWS}
if csDesigning in ComponentState then
raise EROIDEProblem.Create('We''re sorry, but the '+ClassName+' cannot be used inside the Delphi IDE at designtime.');
{$ENDIF MSWINDOWS}
{$ENDIF DESIGNTIME}
fServerChannel.SendRequest(aRequest, aResponse);
end;
procedure TROLocalChannel.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited;
if (Operation=opRemove) and
(AComponent=fServerChannel) then fServerChannel := NIL;
end;
initialization
RegisterTransportChannelClass(TROLocalChannel);
finalization
UnRegisterTransportChannelClass(TROLocalChannel);
end.