Results 1 to 2 of 2
HI everybody,
I wrote a simple client program, which is connected t the server program (running in different machine)
servaddr.sin_port = htons(80);
inet_pton(AF_INET, serv_ip, &servaddr.sin_addr);
with the above mentioned commands ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-20-2007 #1Linux Newbie
- Join Date
- Oct 2006
- Posts
- 107
port opening
HI everybody,
I wrote a simple client program, which is connected t the server program (running in different machine)
servaddr.sin_port = htons(80);
inet_pton(AF_INET, serv_ip, &servaddr.sin_addr);
with the above mentioned commands , the client can able to connect to a particular port...
But ,
I want to open a particular port in client side , and with this port only i need to connect with server port.
For this , what i have to do Pls help me........
Thanks in Advance.
- 05-21-2007 #2Just Joined!
- Join Date
- May 2007
- Posts
- 1
I think you should to call bind to specify a local address before you call connect.
Otherwise, the kernal proto-stack will select a random port for your local address.


Reply With Quote
