Find the answer to your Linux question:
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.
  1. #1
    Linux 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.

  2. #2
    Just 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •