Just a guess, form would somehow be creating client before the server (wouldn't surprise me, alphabetically C comes before S), and therefore not be able to connect. You could ensure that by setting Active to false, and in the startup, for example TForm's onCreate event set it to true.