updated to use esp_netif_init instead of tcpip_adapter in initialization code
Fixed error caused by unnecessary reopening of listening socket. Extracted packet retransmit logic to separate function. Added robust implementation for sending data Closes https://github.com/espressif/esp-idf/pull/3597