Hi, I'm working in the same team with Rajiv. We are using lNetBase (console) version.
The Structure:
We have a class (called TalkHdlr) that manage connection, encoding, decoding of messages and also ping from server. This class is created on FormCreate. When we need to send a message the class check if in the stringlist there is present a connection with same IP:Port and if not it call the init procedure that creates a new one and add it's IP:Port to the list. In the init we Create a new TLTCP passing it a reference to main form, assigning all needed events, address and make a loop on .callAction until it become .connected or are passing 15 seconds, after this i enable the 100ms timer that calls .callAction.
The real use:
We have a timer that every 30 seconds try to send authentication message to server, and if the connection is not present it creates a new one as described above.
The test use:
In a test application i have a timer that every 30 seconds try to connect to server. I'v arrived to try to recreate TalkHdlr every time i try to connect and call directly the connection init procedure, but i get always the same error (IP:Port::Error): 0.0.0.0:8014::Error on connect: connection refused. The IP i try is real IP of server or DNS, but i get always that 0.0.0.0 in error.
As Rajiv said if we manually launch application after connection is up this mechanism works just perfect, it disconnects on network errors, connection down, unplugging of network cable ecc. and then when connection is restored it reconnects.
If we launch application with no network it gives same error always...