title: Allowed Port Range for TCP
body: <p>I am trying to generate a random port number for a TCP connection. From : <a href="http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers" rel="noreferrer">http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers</a> I know that the range of ports is from 1024 to 49151 are not reserved, but some of them are UDP only, how can I generate only valid TCP port numbers?</p>