[twsocket] Can't Connect again after close on TWSocket

Stephen Williams SWilliams@fm.optus.net.au
Mon, 26 Jun 2000 09:59:48 +1000

Setting address, port, proto, etc is such a simple task that you should do
it every time before you call Connect.  Firstly, this ensures the component
has the latest correct values and it is not safe to rely on design time
values still being valid at run-time.

Get into the habit of explicitly setting those values before each call to
Connect or Listen.  It will make you a better programmer.

If you really want to keep using the design time values, store them
immediately after the program starts and then reset the properties to those
values immediately before a Connect or Listen.

Steve 'Sly' Williams
IT Development
Cable & Wireless Optus Outsourcing Services
"Programming is an art form that fights back." -Unknown

> The close function calls the AssignDefaultValue routine which 
> appears to
> replace some of the design time values that get set during 
> the create of
> the socket. I traced into the connect after a Close and the
> FPortAssigned in False after the first connect causing an error 0.
> Is there a different way to disconnect and reconnect a socket 
> so it can
> use the design time Values.