Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pls Help C Problem

Status
Not open for further replies.

matmil

Technical User
Mar 18, 2005
6
US
Hi,

I have an application with sends out udp data while also receiving udp data.. I wanted to make sure that if I send out some data, and the app listened on that port for traffic that if you sent it out on one ip then it could not be received on that ip...

This is how I tried to do it...

char *cli_ip;

.....

cli_ip = inet_ntoa(sending_addr.sin_addr);
if ((strcmp(cli_ip,(inet_ntoa(*(struct in_addr *)h->h_addr_list[0]))))!=0)
{
....
}

This does not work and it never enters this if statement..
Any ideas...

Matt
 
Your if statement is way too complicated. Please simplify and your answer will probably be obvious. If not, please simplify and repost.

Brudnakm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top