Tracking for a few days, the problem probably lies in the simulator to get local IP phones. After changing the IP to get a little strange. IP conversion functions:
static int st_comm_getIpAddr (char * ipaddr, size_t len)
{
int fd;
char buffer [COMM_ADDRSIZE];
struct ifreq ifr;
struct sockaddr_in * addr;
if ((fd = socket (AF_INET, SOCK_DGRAM, 0))> = 0)
{
strncpy (ifr.ifr_name, COMM_ETHNAME, IFNAMSIZ);
ifr.ifr_name [IFNAMSIZ - 1] = '\ 0';
if (ioctl (fd, SIOCGIFADDR, & ifr) == 0)
{
addr = (struct sockaddr_in *) & (ifr.ifr_addr);
inet_ntop (AF_INET, & addr-> sin_addr, buffer, 20);
}
else
{
close (fd);
return (-1);
}
}
else
{
return (-1);
}
if (strlen (buffer)> len-1)
{
return (-1);
}
strncpy (ipaddr, buffer, len);
close (fd);
return (0);
}
IP This function converted my side is:. 10.0.2.15 This is resolved in the phone emulator, I want to connect the device is inside the LAN.
Then I use Windows native IP access on Windows test no problem, the phone does not work. Multicast can play video. Function:
/ / get the host IP address
if (gethostname (hostname, 128) == 0)
{
phost = gethostbyname (hostname);
paddr = inet_ntoa (* (struct in_addr *) phost-> h_addr_list [0]);
strncpy (buffer, paddr, 16);
}
Acquired IP is: 127.0.0.1. I feel sure this IP problem. Join the multicast group no success. And it will get me to the IP under windows is my native LAN IP, 192.168.5.239 I want communication equipment for the LAN IP 192.168.5.244.
Inside the eclipse here to ask how to configure the emulator IP? Andrews UDP traffic inside the phone have any special requirements? How to get local IP phone?
Who knows what is the reason? IP phones to get what is the same?<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
I rely on, no one answer. It points out how to send ah.
Reply:
The problem has been resolved to give his personal following. Results posted to the sub-ah!
Reply:
I come! ......
Reply:
Reply:
thanks!
Reply:
I would like to ask, how about dropping the case?
Reply:
Brothers, what the problem solved? I also encountered a similar problem, you need to modify the IP address of android emulator
No comments:
Post a Comment