Sorry for the confusion.
1. The telemetry xml file is received on the first port (12345)
2. The waypoint xml file is sent to the second port (6789)
The script needs to act as the client to both ports where it is reading from one port (12345) and send to another (6789). The questions I have is how do I know which port I'm reading from and which port I'm sending to?