Can I run programs using TCP / IP from the IDE and expect them to work?

I simply ventured to write my first socket-based programs in Delphi 2010. I tried with Indy, without success, just wrote a simple client and server that could send packets. Then I used TTCPServer and TTCPClient, the same results using the following “simple as it turns out” demo: -

Demo version of Emmbercadero TTCPServer

Emmbercadero demo TTCPClient

I launched 2 instances of the IDE for client and server applications. I was pretty determined to avoid shame on posting a question regarding the socket-based helloworld version, and I just spent 2 days on everything.

Well, I just decided to stick a towel in and ask you to help before I did this, I just run exes from OUTSIDE IDE ... and yes, they worked! They worked all the time, but not from within the IDE.

Can I run these programs inside the IDE? Thanks.

+7
delphi delphi-2010
source share
4 answers

Thank you for your help. I just found a solution to my problem ...

I installed a trial version of Diamond Port Explorer some time ago, which has since expired. When I tried to get a simple Indy TIdTCPServer operation, I got error 10146 (or 10106 I don’t remember) that was “not initialized”. I also noted that the Ide event log was unloaded by the module when I tried to install TIdTCPServer.Active: = true on dcsws2.dll - this is a dll from Diamond PortExplorer (which actually did not start).

So, I uninstalled Diamond PortExplorer, and now I have no problem!

+1
source share

There should not be a problem inside the IDE. I do this all the time.

Make sure that you do not freeze threads in the debugger, as the server will work in threads.

+4
source share

TCP / IP programs (both Client and Server) can be safely started from Delphi.

The only thing that may worry about your FireWall settings, but it may not be a problem, is that your program has access to the network.

During debugging, if you do step-by-step (F7 / F8 keys), only one thread starts, so any background thread (for example, server thread) will not work.

You must start the Server before starting the Client at your discretion.

I never used the TTCPClient and TTCPServer classes, which turned out to be erroneous ... try using a different framework like Indy, Synapse or our SynCrtSock.

What version of the Delphi IDE are you using? What operating system?

+2
source share

I had similar problems when deploying datasnap server and client. The problem was that DSServer was already running and the port was in use. Therefore, make sure that you check all your ports and whether your connections are active in the IDE, as well as in running applications.

0
source share

All Articles