Closed hmaurer closed 11 years ago
client.Close() doesn't dispatch any event, nor allows some kind of teardown procedure when a client is disconnected. Use close_conn(ctx, client) instead.
But it will stop the handle_conn's loop (conn.Recv will return an io.EOF error) which will invoke close_conn (because of the defer instruction).
handle_conn
close_conn
defer
client.Close() doesn't dispatch any event, nor allows some kind of teardown procedure when a client is disconnected. Use close_conn(ctx, client) instead.