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 Test with No Server?
What is the difference between socket & port?
What are Nameless Sockets?
How to Form Abstract Local Addresses?
What is the use of PF_INET and SOCK_STREAM?
What is socket file in linux?
How to Manipulate IP Numbers?
What is socket abstraction?
What are Private IP Numbers?
What is socket linux?
How to Initialize a Wild Internet Address?
What is socket and how it works?
What is the Use of the inet_ntoa() Function?
What are Anonymous Calls?
What are the different types of sockets?