我决定从SOAP服务器迁移到DataSnap服务器&休息。我查看并关注了几个教程,甚至尝试过DXE5演示,但我仍然得到相同的结果。问题是我无法将客户端应用程序上的TSQLConnection连接到正在运行的DataSnap服务器。
以下是代码:
Socket Error # 10061
Connection refused..
OS = Windows 7 64bit
RAD Studio XE5 Update 2
遵循Pawel Glowacki(和哦)的DataSnap多层视频教程。
在创建Datasnap客户端/服务器应用程序时,我无法将客户端TSQLConnection连接到DSServer。
服务器正在运行(localhost)!
Firewal取消激活。
将端口211添加到Windows防火墙入站&出境规则。
我尝试过创建一个DataSnat REST应用程序并发生同样的错误。
在DXE和DXE3中执行此操作时,我得到的结果相同。
重现的步骤
这是堆栈跟踪。
[5110E67F]{IndySystem190.bpl} IdStack.TIdStack.RaiseSocketError (Line 771, "IdStack.pas" + 42) + $21
[5110E606]{IndySystem190.bpl} IdStack.TIdStack.RaiseLastSocketError (Line 725, "IdStack.pas" + 1) + $F
[5110E571]{IndySystem190.bpl} IdStack.TIdStack.CheckForSocketError (Line 699, "IdStack.pas" + 2) + $3
[5110A9F4]{IndySystem190.bpl} IdStackWindows.TIdStackWindows.Connect (Line 1771, "IdStackWindows.pas" + 20) + $13
[50DF5849]{IndyCore190.bpl} IdSocketHandle.TIdSocketHandle.Connect (Line 294, "IdSocketHandle.pas" + 1) + $25
[50E01CF9]{IndyCore190.bpl} IdIOHandlerStack.TIdIOHandlerStack.ConnectClient (Line 344, "IdIOHandlerStack.pas" + 52) + $A
[50E05283]{IndyCore190.bpl} IdIOHandlerSocket.TIdIOHandlerSocket.Open (Line 332, "IdIOHandlerSocket.pas" + 13) + $4
[50E01011]{IndyCore190.bpl} IdTCPClient.TIdTCPClientCustom.Connect (Line 317, "IdTCPClient.pas" + 52) + $B
[16F76AFD]{IndyIPClient190.bpl} IPPeerClient.TIdTCPClientPeerIP.Connect (Line 1166, "IPPeerClient.pas" + 0) + $5
[520AC809]{DbxClientDriver190.bpl} Data.DbxSocketChannelNative.TDBXIdTCPLayer.Open (Line 378, "Data.DbxSocketChannelNative.pas" + 27) + $5
[520AC44B]{DbxClientDriver190.bpl} Data.DbxSocketChannelNative.TDBXSocketChannel.Open (Line 149, "Data.DbxSocketChannelNative.pas" + 13) + $E
[50059970]{rtl190.bpl } System.@FreeMem (Line 4364, "System.pas" + 20) + $0
[50060DA0]{rtl190.bpl } System.@UStrClr (Line 23846, "System.pas" + 14) + $0
[520AEA09]{DbxClientDriver190.bpl} Data.DBXTransportFilter.TDBXFilterSocketChannel.SetDBXProperties (Line 712, "Data.DBXTransportFilter.pas" + 8) + $10
[520AE999]{DbxClientDriver190.bpl} Data.DBXTransportFilter.TDBXFilterSocketChannel.Open (Line 693, "Data.DBXTransportFilter.pas" + 0) + $5
[520B0897]{DbxClientDriver190.bpl} Data.DBXClient.TDBXClientConnection.DerivedOpen (Line 430, "Data.DBXClient.pas" + 5) + $8
[5214F8D7]{DbxCommonDriver190.bpl} Data.DBXCommon.TDBXConnection.Open (Line 8599, "Data.DBXCommon.pas" + 5) + $4
[5214AC72]{DbxCommonDriver190.bpl} Data.DBXCommon.TDBXConnectionFactory.GetConnection (Line 6724, "Data.DBXCommon.pas" + 14) + $5
[5214AB6D]{DbxCommonDriver190.bpl} Data.DBXCommon.TDBXConnectionFactory.GetConnection (Line 6701, "Data.DBXCommon.pas" + 0) + $5
[51392D29]{dbexpress190.bpl} Data.SqlExpr.TSQLConnection.DoConnect (Line 2490, "Data.SqlExpr.pas" + 56) + $6
[50A8AA4D]{dbrtl190.bpl} Data.DB.TCustomConnection.SetConnected (Line 3482, "Data.DB.pas" + 8) + $4
[50128326]{rtl190.bpl } System.TypInfo.SetOrdProp (Line 2583, "System.TypInfo.pas" + 21) + $1
[2110BA52]{designide190.bpl} DesignEditors.TPropertyEditor.SetOrdValue (Line 839, "DesignEditors.pas" + 2) + $E
[211564F7]{designide190.bpl} VCLEditors.TBooleanProperty.MouseUp (Line 1864, "VCLEditors.pas" + 5) + $10
[212A13CD]{vclide190.bpl} PropBox.TCustomPropListBox.ItemMouseUp (Line 1631, "PropBox.pas" + 17) + $1B
[212A15C3]{vclide190.bpl} PropBox.TCustomPropListBox.MouseUp (Line 1696, "PropBox.pas" + 1) + $D
[504634D8]{vcl190.bpl } Vcl.Controls.TControl.DoMouseUp (Line 7468, "Vcl.Controls.pas" + 2) + $28
[50463554]{vcl190.bpl } Vcl.Controls.TControl.WMLButtonUp (Line 7481, "Vcl.Controls.pas" + 9) + $6
[212A6D50]{vclide190.bpl} IDEInspListBox.TInspListBox.WMLButtonUp (Line 1632, "IDEInspListBox.pas" + 3) + $4
[50462B49]{vcl190.bpl } Vcl.Controls.TControl.WndProc (Line 7224, "Vcl.Controls.pas" + 91) + $6
[1ECD5CD1]{cxLibraryRS19.bpl} dxHooks.TdxSystemHook.ProcessHookProcs$qqriuii + $99
[1ECD5A9A]{cxLibraryRS19.bpl} dxHooks.dxSystemGetMessageHook$qqsiuii + $16
[50466E9F]{vcl190.bpl } Vcl.Controls.TWinControl.IsControlMouseMsg (Line 9807, "Vcl.Controls.pas" + 1) + $9
[50467669]{vcl190.bpl } Vcl.Controls.TWinControl.WndProc (Line 10039, "Vcl.Controls.pas" + 153) + $6
[5048AF69]{vcl190.bpl } Vcl.StdCtrls.TCustomListBox.WndProc (Line 7108, "Vcl.StdCtrls.pas" + 55) + $5
[50466CAC]{vcl190.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 9751, "Vcl.Controls.pas" + 3) + $6
[501749C4]{rtl190.bpl } System.Classes.StdWndProc (Line 17010, "System.Classes.pas" + 5) + $0
[5059214F]{vcl190.bpl } Vcl.Forms.TApplication.CancelHint (Line 11117, "Vcl.Forms.pas" + 6) + $E
[50590DC3]{vcl190.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 10288, "Vcl.Forms.pas" + 23) + $1
[50590E06]{vcl190.bpl } Vcl.Forms.TApplication.HandleMessage (Line 10318, "Vcl.Forms.pas" + 1) + $4
[50591141]{vcl190.bpl } Vcl.Forms.TApplication.Run (Line 10456, "Vcl.Forms.pas" + 26) + $3
我该怎么做?
答案 0 :(得分:2)
确保ServerContainer数据模块在启动时自动创建,或自行创建。
答案 1 :(得分:1)
我收到套接字错误#10061,向导在LocalHost上创建DataSnap REST客户端模块(测试端口8080时)
我做的是运行DataSnap REST服务器应用程序(.exe)并在端口8080上的LocalHost上启动它。我添加了一个新的DataSnap REST客户端模块。测试了8080端口和voilà!它奏效了。
答案 2 :(得分:-1)
通过向TDSTCPServerTransport
数据模块中添加ServerContainer
组件来解决此问题。