Click here to Skip to main content
15,891,745 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have used the following code

server.sin_addr.s_addr = inet_addr("10.170.0.42"); in my program to accept and receive images i.e in my localhost only.

how to accept the images without defining particular IP, means how can i accept images from n number of users.

can somebody give the syntax
Posted
Updated 4-Jan-15 23:37pm
Comments
Richard MacCutchan 5-Jan-15 6:39am    
The server's address does not matter, it is only important for the clients to know it so they can connect.

1 solution

The syntax is


serveraddr_A.sin_addr.s_addr=htonl(INADDR_ANY);

this is the syntax for getting any IP adre.ss
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900