Sockclose is called when the server closes the socket, which it should do automatically when it has finished sending data (if the connection: close header was specified).

I perform a sockclose myself in the twitch.auth.request because in that instance I'm acting as a server to receive the token request when the browser redirects to the redirect_uri, it's not necessary for you.