how to get client port number in server socket programming??
Answer Posted / supraja aldena
After accepting connection.Just type this, u wil get
client ip address and port number.
printf("\n(%s , %d)\n",inet_ntoa(client.sin_addr),ntohs
(client.sin_port));
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
How to perform I/O on Sockets?
What are Anonymous Calls?
How to Form Internet (IPv4) Socket Addresses?
How to open socket file in linux?
How TCP/IP Handles Sequencing?
What is socket and how it works?
Are sockets full duplex?
What is the use of SOCK_DGRAM Socket Type?
How to Manipulate IP Numbers?
How to Choose a Socket Type?
How does socket communication work?
What is the use of PF_INET and SOCK_STREAM?
How TCP/IP Handles Lost Packets?
How TCP/IP Handles Flow Control?
What is the use of endprotoent(3) Function