Why am I not getting the right port number?

Why am I not getting the right port number?

Post by bha.. » Thu, 13 Oct 1994 05:14:29



Hi,

I have a simple client server program in which the client and
an iterative server use post number 3000. Sockets are opened
using TCP ports.

I am trying to print the port number client uses in
the following way:

    newpsock = accept(psock, (struct sockaddr *) &perfaddr, &perflen);

        printf("The port number is  %d\n", perfaddr.sin_port);

But this is what I am getting:

The port number is   2445
The port number is   2446
The port number is   2447
The port number is   2448
The port number is   2449
The port number is   2450
The port number is   2451
The port number is   2452
The port number is   2453

Why am I not able to get the right port number?

I am using Solaris 2.1.


Many thanks in advance.

- Bharat

 
 
 

1. Why am I not getting the right port number?

Hi,

I have a simple client server program in which the client and
an iterative server use post number 3000. Sockets are opened
using TCP ports.

I am trying to print the port number client uses in
the following way:

    newpsock = accept(psock, (struct sockaddr *) &perfaddr, &perflen);

        printf("The port number is  %d\n", perfaddr.sin_port);

But this is what I am getting:

The port number is   2445
The port number is   2446
The port number is   2447
The port number is   2448
The port number is   2449
The port number is   2450
The port number is   2451
The port number is   2452
The port number is   2453

Why am I not able to get the right port number?

I am using Solaris 2.1.


Many thanks in advance.

- Bharat

2. 3Com Ethernet adapters <- IMPORTANT

3. Why am I getting "ILLEGAL PORT COMMAND" messages?

4. getrusage() and memory usage fields. Does it work?

5. Why am I getting hits on port 119?

6. disk solstice backup

7. Q: Why am I getting "Sorry - PPP is not available on this system"?????

8. make error

9. why could not I found my port number?

10. This clone thing...am I stupid, or am I right?

11. Am I touchy? Or am I right?

12. I am getting "linux-atm-2.4.0" not found, does anybody have an idea, why I am getting this?.