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 TCP/IP Handles Sequencing?
How to Examin the Generic Socket Address?
What is the use of PF_INET or AF_INET?
What is socket connection?
What is the use of endservent(3) Function?
What is the use of PF_INET and SOCK_STREAM?
What is the Use of the inet_makeaddr() Function?
What is AF_UNSPEC Address?
Are sockets full duplex?
How to Reply to a Wild Address?
How to Test with No Server?
How to Form Internet (IPv4) Socket Addresses?
What is a socket in linux?
What is socket and how it works?
How to Form Local Addresses?