Did you place a
Code:
sockclose $sockname
under your sockread event? If the socket has been closed already, the sockclose event won't get triggered.