If your LAN is connected on the Mega, you could try MQTT, but that completely depends on what you are using it for. Try looking for B4RSerializator and MQTT. You can either use a free online MQTT broker service or run your own in house MQTT broker via a spare Android device, just search the forum for MQTT broker or MQTT Mosquitto.
By the way you can also look at Asyncstream with server socket if you do not fancy using MQTT.