I have decided to move from SOAP servers to DataSnap servers & REST. I have viewed and followed several tutorials and even tried the DXE5 demos but I keep getting the same result. The issue is that I cannot connect the TSQLConnection on the client app to the DataSnap server that is running.
Here is the Code :
Socket Error # 10061
Connection refused..
OS = Windows 7 64bit
RAD Studio XE5 Update 2
Following DataSnap multi-tier video tutorial by Pawel Glowacki (and ohters).
In creating a Datasnap client/server app, I cannot connect the client TSQLConnection to the DSServer.
The server is running (localhost)!
Firewal de-activated.
Added port 211 to Windows Firewall Inbound & Outbound rules.
I have tried creating a DataSnat REST application and the same error occurs.
I get the same results when doing this in DXE and DXE3.
Steps to reproduce
- Create Datasnap server (Tried both DataModule & DSServerModule).
- Leave default port to 211 (Have also tried several other ports (8080, 9000).
- Run the server. All is OK up to here.
- Create a VCL Form App.
- Add a TSQLConnection to Main form.
- Set driver to DataSnap.
- CommunicationProtocol = tcp/ip.
- DataSnapCOntext = datasnap/
- HostName = localhost (have tried 127.0.0.1 and my computer's IP address).
- LoginPropt = False.
- Run server.
- Start server.
- Open in browser works correctly.
- Set Connected property on TSQLConnection to true.
- Socket error 10061 is generated and I cannot get past this.
Here is the stack trace.
[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
How can i do this ?