A
aKnightChen
Unregistered / Unconfirmed
GUEST, unregistred user!
出RMB500元,求RemObject中,如何从客户端传送一个参数给TRODataSnapModule中,以便控制ADOConnection.CommandTimeOut因为而异 ( 积分: 0 )<br />达到的目的:
客户端用RODataSnapConnection连接+ClientDataSet
服务器TRODataSnapModule( ADOQuery+ADOConnection+DataSetProvider )
三层的模架我是测试成功了,但是,我想从客户端传个超时设置超时参数到服务器上,
以便使Create_DataSnapModule过程中,能根据这个超时参数来设定不同的用户有不同的超时设置。
QQ:280789736,电话:020-88475087 陈,
测试步骤:
你先提供服务器程序(EXE)给我,(告诉我连接端口等参数),然后我自已写个简单客户端,
如果可以同时开两个客户端,每个客户端得到不同的CommandTimeOut,
我就付钱给你,然后你把SERVER端代码给我。(server端必须简单,多余的任何功能都不要,同时,如果修改了RemOjbect相关单元,烦请说明哪个单元)
出500元,一点小钱,请不要笑话,有意者和我联系。
(我自已折腾了几天,都熊猫眼也,也没搞定)
以下附我自已做的例子(仅供你参考):
Unit1:
---------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uROClient, uROServer, uROIndyTCPServer, uROIndyHTTPServer,
uROBinMessage;
type
TForm1 = class(TForm)
msg_BIN: TROBinMessage;
HTTPServer: TROIndyHTTPServer;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
=========================================
Unit2,(RemoteDataModul)
-------------
unit Unit2;
interface
uses {vcl:} SysUtils, Classes, DB, DBClient,
{RemObjects:} uRODataSnapModule, Provider, ADODB, uROClient,
uROSessions,uROClassFactories,uROClientIntf;
type
TRODataSnapModule2 = class(TRODataSnapModule)
con_SqlServer: TADOConnection;
qry_customers: TADOQuery;
prv_customers: TDataSetProvider;
private
{ Private declarations }
v:boolean;
public
{ Public declarations }
end;
var
RODataSnapModule2: TRODataSnapModule2;
implementation
uses {RemObjects:} uROServer, uRODataSnap_Invk;
{$R *.DFM}
procedure Create_DataSnapModule(out oInstance:IUnknown);
begin
oInstance := TRODataSnapModule2.Create(nil);
end;
initialization
TROClassFactory.Create('IAppServer', Create_DataSnapModule, TAppServer_Invoker);
end.
**********客户端**************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, DBClient, uROClient, uROBinMessage,
uROWinInetHttpChannel, uRODataSnapConnection, Grids, DBGrids;
type
TForm1 = class(TForm)
RODataSnapConnection: TRODataSnapConnection;
HTTPChannel: TROWinInetHTTPChannel;
ROBinMessage: TROBinMessage;
aa: TClientDataSet;
Button1: TButton;
Memo1: TMemo;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Button2: TButton;
ClientDataSet1: TClientDataSet;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
aa.Close;
aa.CommandText:=Memo1.Lines.Text;
aa.Open;
showmessage('OPEN');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
aa.Close;
aa.CommandText:=Memo1.Lines.Text;
aa.Execute;
showmessage('EXEC');
end;
end.
客户端用RODataSnapConnection连接+ClientDataSet
服务器TRODataSnapModule( ADOQuery+ADOConnection+DataSetProvider )
三层的模架我是测试成功了,但是,我想从客户端传个超时设置超时参数到服务器上,
以便使Create_DataSnapModule过程中,能根据这个超时参数来设定不同的用户有不同的超时设置。
QQ:280789736,电话:020-88475087 陈,
测试步骤:
你先提供服务器程序(EXE)给我,(告诉我连接端口等参数),然后我自已写个简单客户端,
如果可以同时开两个客户端,每个客户端得到不同的CommandTimeOut,
我就付钱给你,然后你把SERVER端代码给我。(server端必须简单,多余的任何功能都不要,同时,如果修改了RemOjbect相关单元,烦请说明哪个单元)
出500元,一点小钱,请不要笑话,有意者和我联系。
(我自已折腾了几天,都熊猫眼也,也没搞定)
以下附我自已做的例子(仅供你参考):
Unit1:
---------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uROClient, uROServer, uROIndyTCPServer, uROIndyHTTPServer,
uROBinMessage;
type
TForm1 = class(TForm)
msg_BIN: TROBinMessage;
HTTPServer: TROIndyHTTPServer;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
=========================================
Unit2,(RemoteDataModul)
-------------
unit Unit2;
interface
uses {vcl:} SysUtils, Classes, DB, DBClient,
{RemObjects:} uRODataSnapModule, Provider, ADODB, uROClient,
uROSessions,uROClassFactories,uROClientIntf;
type
TRODataSnapModule2 = class(TRODataSnapModule)
con_SqlServer: TADOConnection;
qry_customers: TADOQuery;
prv_customers: TDataSetProvider;
private
{ Private declarations }
v:boolean;
public
{ Public declarations }
end;
var
RODataSnapModule2: TRODataSnapModule2;
implementation
uses {RemObjects:} uROServer, uRODataSnap_Invk;
{$R *.DFM}
procedure Create_DataSnapModule(out oInstance:IUnknown);
begin
oInstance := TRODataSnapModule2.Create(nil);
end;
initialization
TROClassFactory.Create('IAppServer', Create_DataSnapModule, TAppServer_Invoker);
end.
**********客户端**************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, DBClient, uROClient, uROBinMessage,
uROWinInetHttpChannel, uRODataSnapConnection, Grids, DBGrids;
type
TForm1 = class(TForm)
RODataSnapConnection: TRODataSnapConnection;
HTTPChannel: TROWinInetHTTPChannel;
ROBinMessage: TROBinMessage;
aa: TClientDataSet;
Button1: TButton;
Memo1: TMemo;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Button2: TButton;
ClientDataSet1: TClientDataSet;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
aa.Close;
aa.CommandText:=Memo1.Lines.Text;
aa.Open;
showmessage('OPEN');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
aa.Close;
aa.CommandText:=Memo1.Lines.Text;
aa.Execute;
showmessage('EXEC');
end;
end.