I want to create a telnet connection in Delphi that will allow me to connect to the command prompt on my computer.
If you want a telnet server, Windows XP and newer comes with a telnet service that just needs to be enable and started via the service control manager. It is disabled by default when windows is installed. I recommend against writing your own telnet server unless you really know what you are doing because you are likely to create a lot of security issues.
Related
I created the 3 necessary containers for NuoDB using the NuoDB instructions.
My Docker environment runs on a virtual Ubuntu Linux environment (VMware).
Afterwards I tried to access the database using a console application (C# .Net Framework 4.8) and the Ado.Net technology. For this I used the Nuget "NuoDb.Data.Client" from Nuget.org.
Unfortunately the connection does not work.
If I choose port 8888, my thread disappears to infinity when I open the connection.
For this reason I tried to open the port 48004 to get to the admin container.
On this way I get an error message.
"System.IO.IOException: A connection attempt failed because the remote peer did not respond properly after a certain period of time, or the established connection was faulty because the connected host did not respond 172.18.0.4:48006, 172.18.0.4"
Interestingly, if I specify a wrong database name, it throws an error:
No suitable transaction engine found for database.
This tells me that it connects to the admin container.
Does anyone have any idea what I am doing wrong?
The connection works when I establish a connection with the tool "dbvisualizer".
This tool accesses the transaction engine directly. For this reason I have opened the port 48006 in the corresponding container.
But even with these settings it does not work with my console application.
Thanks in advance.
Port 8888 is the REST port that you would use from the administration tool such as nuocmd: it allows you to start/stop engines and perform other administrative commands. You would not use this port for SQL clients (as you discovered). The correct port to use for SQL clients is 48004.
Port 48004 allows a SQL client to connect to a "load balancer" facility that will redirect it to one of the running TEs. It's not the case that the SQL traffic is routed through this load balancer: instead, the load balancer replies to the client with the address/port of one of the TEs then the client will disconnect from the load balancer and re-connect directly to the TE at that address/port. For this reason, all the ports that TEs are listening on must also be open to the client, not just 48004.
You did suggest you opened these ports but it's not clear from your post whether you followed all the instructions on the doc page you listed. In particular, were you able to connect to the database using the nuosql command line tool as described here? I strongly recommend that you ensure that simple access like this works correctly, before you attempt to try more sophisticated client access such as using Ado.Net.
In Delphi 10.4.1 I'm trying to build an Android application that connects to an instance of Interbase running on my laptop (which I can connect to remotely from my desktop). I get the exception:
Project Project6.apk raised exception class EIBNativeException with message '[FireDAC][Phys][IBLite]Unable to complete network request to host "192.168.1.58".
Failed to locate host machine.
Undefined service gds_db/tcp.'.
Connection Parameters:
Database=192.168.1.58:C:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\data\employee.gdb
User_Name=sysdba
Password=masterkey
DriverID=IB
Everything works fine if I connect to a local database, or run the app on Windows.
I've seen this demonstrated in XE7 (https://youtu.be/XAZQfYzvxHc?t=1384), but can't get it to work in 10.4.1.
What am I doing wrong?
If InterBase on your Windows machine is running on default instance 'gds_db', then it is probably using TCP socket on port 3050. Try changing your Android application's Database URL to the following so it includes the target 3050 port number. I am assuming that it is not automatically able to resolve 'gds_db' name on Android since the TCP socket service name is not defined on Android. On Desktop platforms like Windows, Linux, macOS, the InterBase installer updates the system services file to provide the translation of 'gds_db' name to 3050. Just providing a TCP socket port number is a failproof way to target an endpoint without need for name resolution.
Database=192.168.1.58/3050:C:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\data\employee.gdb
I have some delphi applications with connection to Firebird database by FireDAC technology. It works fine, but after Windows 10 update 1803, cannot connect to database when I call application stored in network path (example: \comp1\share\myapp.exe or Q:\myapp.exe, Q: is mapped server path). Error status is 335544721 with illegal parameter.
The same build of application stored on local path works fine. Can anybody help Me?
I've got the same problem!! The reason is the Firebird version 1.5.x (maybe 2.5 too?). Windows Update 1803 blocks the communication between client and server. The only solution is to migrate to Firebird 3.0.x (or to uninstall the update - not a really good option).
I had the same problem with my delphi application I developed a couple years ago, after an update to windows 10 in one of my machines it suddenly drops the connection to the firebird server (2.50 in superserver mode) installed on a windows 7 host, while my other hosts (win xp, win 2003, win 7 and 8.1) connects normally, when I ping or telnet to the server adresse from win10 (telnet 192.168.1.X 3050) the connection establishes, I have tried everything like enabling Smbv1 and disabling v2 and v3, run it under a VM (win 7) machine inside win10 I was surprised to not being able to connect too, then I realised that it wasn't a network hardware configuration problem, but for unexplained reasons WINDOWS DEFENDER, I just disabled it and then my app was able to connect.
And don't rely on firebird's returned error messages they don't discribe the real issue, and can mislead you.
I forgot to mention that I did enabled some services before disabling win defender, wich were disabled after windows update 1803:
Set both Function Discovery Services to Automatic and Start Them
SSDP Discovery set to automatic.
UPnP Device Host set to automatic.
I have installed Firebird 3.0.1 on a PC and on a VM client. I installed Flamerobin on both to test the connection.
I can connect to localhost on both PC and VM using Flamerobin, so I assume the Firebird server is running on both and Flamerobin is installed on both OK
I can connect to the Firebird server on the VM from the PC and open a database Ok
From the VM I can open a database on the PC, but when I try to retrieve the server version on the PC I get an error ISC_Service_attach failed (Unable to complete network request to host).
I have no idea what the problem is given that I can open a database ok, but cannot access any of the utility services.
I am using fbclient.dll 3.0.1.32591 on both VM and PC
If you can achieve network request to server, you need to check firewall setings on server and set fb default port as inbound acceptable. If you would had same problem after that, than you probably need proper fbclient library, for FB3 on client, VM. Hope this helps.
I have a legacy DCOM server and client application both written in Delphi v6. The DCOM server is currently configured to run once and service all clients. The main reason for it running once is that the server provides an interface to an accounts application and must logon and can only do this once for a given user name.
Our customer now wants to upgrade their server to Windows Server 2008 R2 leaving the clients on Windows XP but I have been unable to replicate the current set-up.
The current set up that I can get to work on a test rig is slightly odd!
I have to configure DCOM settings to allow remote launch or I get access denied on the client
If the DCOM server is not already running, when the client tries to connect to it I get server execution failed.
If the server is running and the launch permission is set to allow remote launch, the client starts a new instance of the DCOM server rather than using the instance already started. This then causes problems in the accounts application as the same user tries to logon which is not allowed.
If I close the DCOM server running on the server, the client happily works away with its own instance. I cannot see the DCOM servers main form though as its running in the background (can see it in task manager)
I've found various articles to do with this problem but nothing so far has worked. These include running the DCOM server as administrator, not running the DCOM server as administrator, allowing COM+ in the firewall, adding the DCOM server to the firewall, the DCOM server located in SysWOW64, using the 32 bit version of DCOMCNFG, etc.
Now not sure where to go...
Thanks for any help
Simon
DCOM default permissions has changed in XP SP2 and 2003 SP1. You'll need to configure the properly to make your service running properly. Usually, unless you implement the DCOM server in a service (something Delphi doesn't allow due to limited DCOM support), the DCOM server is started when a user connects, and that's why you may need the "remote launch" permissions.
Moreover a DCOM server may be started in the context of a given user, the interactive user (must be avoided for remote clients!), or the launching user. What mode are you using? - if it is set to "launching user" it will always create a new instance. How was your server instanced before the new OS? How is its class factory implemented?
See here for some interesting information about DCOM and Delphi implementations.
BTW:
Never run your DCOM server with Administrators privileges unless it really needs it. Otherwise you can create a security hole.
If a firewall is present, both the RPC endpoint port and the ports configured for DCOM must be opened to the calling clients.
Don't mess system directories with your application. There's no need, if your app works only there you have a privileges misconfiguration, and you won't solve it properly putting files where they don't belong to.