Yes I did something similar and it goes to OnConnecting, but then the Exceptions comes directly afterwards.
Main Topics
Browse All TopicsHi all,
that's the situation:
My server program is open and listening.
My client program starts with a wrong hostname. Then I change the hostname at runtime to the correct one, and it immediately raises an ESocketError on API 'connect'. So it found the server socket, but couldn't connect for some reason.
(when I change the hostname to anther wrong hostname at runtime, it will take a few seconds and then raise an Exception with an Windows Socket Error on API 'ASyncLookup'.)
When I start the client program with the correct hostname, it DOES connect.
As far as I can see, my code is exactly the same.
WMNEWSERVER is called when ServerName is already the new host name.
procedure TFoClient.WMNEWSERVER (var Msg: TMsg);
begin
if ClieSock.Active then
ClieSock.Active := false;
ClieSock.Host := ServerName;
ClieSock.Port := 1300;
ClieSock.Active := true;
end;
procedure TFoClient.FormCreate(Sende
begin
...
ClieSock.Host := ServerName;
ClieSock.Port := 1300;
ClieSock.Active := true;
end;
Another thing is that my ClientSocket never gets to TClientSocket.OnError but raises an exception FIRST. Maybe this is somehow related?
Thanks for any help,
Fran
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
anyway, my Client/Server programme is working well but its running on Win95. After about 200-300 hrs of non-stop running, the errorboxes will pop up. I have about 3-4 Server apps running altogether on the PC and they all cause errors after running for long time on Win95, all the errors pop up around the same time. After a reboot, everything runs back to normal. Guess sometimes the OS is the problem.....now i did a simple programme to remind me to reboot after 100 hours of runtime. :) so far, no more errors. Hope this is of help to you.
Business Accounts
Answer for Membership
by: tyfingPosted on 2003-01-13 at 20:40:27ID: 7722752
use clientsocket's onconnecting function,
is establishing connection';
showmessage('Clientsocket1
this way, u can rule out/pin point if your CS is setting off or not. i