There is no such identifier as: $sockclose()
It's supposed to be:
if $sock(imgur) { sockclose $v1 }
I'm not aware of the -n switch for the sockopen command. I don't believe there is one but the -d and -e switch.