You should probably wait with closing down the server until data is sent instead of using a timer. You might use OnDataSent and check the property AllSent before closing down. Then you can post a custom message to close down the server instead of using a timer, a slow line could use more than 500 ms.
When using just a timer, the browser might try to connect to the specified port before you start your server listening on that port. How about creating a new server when you want to change port, and free the current one in OnDataSent? You say that the client don't change the port, the problem might be that the client try to connect before you set up your server listening on that port. Regards Bjørnar -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: 25. april 2005 13:56 To: ICS support mailing Subject: [twsocket] Redirect a browser to another port Hello, I have HTTP server application. User has possibility to change listening port. Is it possible to redirect a browser to another port ? Now I send this to delay the browser and I restart server outside of the events by a timer 500 ms, to be sure this document has reached the browser. But of course when they change port it will not reconnect. I already tryed with 'url=:' + FPort + '/index.html' in the url string but this is not working. Someone knows how ? Doc := '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">'#13#10 + '<html><head><title>Linker gateway</title>'#13#10 + '<meta http-equiv="Refresh" content="2;url=/index.html">'#13#10 + '</head><body><br><br><br><div align="center">'#13#10 + '<h1>Please wait a moment, server is restarting</h1>'#13#10 + '</div></body></html>'; SendDocument(Cli, Doc); -- Rgds, Wilfried http://www.mestdagh.biz -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be