on_prepare method to tune the socket before usage