sockets - Closing a connection and re-opening with Synapse in Lazarus -
sockets - Closing a connection and re-opening with Synapse in Lazarus -
i'm using synapse library lazarus , i'm trying switch tcpblocksocket connection between 2 different ip addresses.
i create socket connection with:
mysocket:=ttcpblocksocket.create i connect first ip address with:
mysocket.connect(firstipaddress,portnumber); this works fine, if seek switch sec ip address with
mysocket.connect(secondipaddress,portnumber); any info send mysocket.sendstring() still sent firstipaddress.
i have tried .destroying mysocket , recreating crashes (i check if mysocket assigned , if .destory before recreating tcpblocksocket object - seems bit severe anyway.
is there right way disconnect , reconnect exiting tcpblocksocket different ip address?
and there easy way test if tcpblocksocket has active , working connection?
it's obvious when find it...
you need phone call mysocket.closesocket() before calling .connect new ip address , port.
(still problems checking if opened connection still open , working though - per comment op)
sockets tcp lazarus fpc
Comments
Post a Comment