title: How to get Ephemeral port number
body: <p>In Socket Programming, I am not binding the socket to a specific port number.</p>
  
  <p>So while sending data through the socket, an ephemeral port is assigned automatically and the data is sent.</p>
  
  <p>So is there any way to get the ephemeral port just before the connection is opened or data is sent ?</p>
  
  <p>Thanks</p>
  
  <p>Sri </p>