I have a server that firstly takes a TCP connection, then, on another thread, listens for a specific UDP packet (from all sources on a port) to be noticed and the endpoint associated with and used alongside the TCP connection.
My question is: Is it possible for one thread of my program to listen to a port from any connection and another thread to only listen to a specific endpoint? This seems wrong.
Also, is there an easier way to establish a UDP connection parallel to a TCP connection that can utilize UDP hole punching implementation?
Note: I'm trying to keep this all on one port, instead of using many.
[Edit: Confusing sentence]