is there are method to force the local port number when making a tcp connection?

for example, i am connecting to an RSH service to port 514, but i need the source port to be 1023...

Qt Code:
  1. void Process::connectToRsh()
  2. {
  3.  
  4. blockSize = 0;
  5. tcpSocket->abort();
  6. tcpSocket->connectToHost(ui.IpAddressLineEdit->text(),514);
  7. ui.ResultsTextEdit->append(tr("connecting"));
  8. }
To copy to clipboard, switch view to plain text mode 

So its easy to see how to connect to port 514, but what about the local one?

Thanks!
chris