By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,052 Members | 1,551 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,052 IT Pros & Developers. It's quick & easy.

Sockets. How to change the port that is assigned automatically onthe client

P: n/a
LEM
Hi all,

When a client tries to connect to a server, a random port number
is assigned to the client that will be used for the communication with
the server (typically the next free port above 1024). As far as I know
this port is chosen before connecting to the server.

I need to be able to specify a fixed port number there, instead of
letting the system to choose it. Does anybody know how to do it in
C#.

This is what I'm using for connecting

tcpClient = new TcpClient();
tcpClient.BeginConnect(SERVERIP, SERVERPORT, CALLBACKFUNTION, this);

Thanks a lot!
Oct 2 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
LEM

Vadym, thanks a lot!! I really appreciate your help.
That's exactly what I need.

Regards
Oct 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.