This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

kill a socket

Old posts that have not been replied to for several years.
Locked
l
loze

kill a socket

Post by loze »

i open a tcl-socket and i want to kill it. I have try close $sock but that just close the connection and i have try unset sock but it not worked. So my question is how do i kill the socket?!
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

a simple "close <sock-id>" is sufficient.

EG, your socket pointer is located in $sock

close $sock

Doing

unset sock

will only unset the variable sock, and lot close any connection.

It would be wise to use
catch {close $sock}
though
Locked