Socket problem

I am trying to connect to a server from a certain local port. Is this possible? As far as I know when i create a new connection i can specify the host and the port of the server that i am connecting to but the operating system will generate me a local port. Can I choose that local port? or at least find it’s value(without asking the server)?

I am trying to do this in flex but if it’s not possible and it is possible in flash that would be fine too.
[RIGHT]Thank you !
[/RIGHT]