Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: port opening

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    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