How to disconnect from a TCP socket

currently i am using mg_connect to open a TCP socket to a destination and transacting.

i would like to know how to a close the connection afterwards.
there is nothing i can find in the documentation relating to this.
kind regards

When you finish processing just set nc->flags |= MG_F_CLOSE_IMMEDIATELY; where nc is the struct mg_connection * argument of your event handler set in mg_connect.

thank you… will try it.