Tool/software:
Hi,
I am trying to use enet_lwip example from the pdk and added a small udp_client thread which tried to send some messages to the server.
Server ip: 192.168.3.1
Client ip; 192.168.3.30
I have added an app as part of LWIP_APP_INIT, lets call it chris_udp_app, and if the chris_udp_thread code is udp_server, then it seems to work to some extent, i.e, I can receive data on this server thread from the client that is running on a linux pc.
But if I configure the chris_udp_thread code to be udp_client, then I get the error that udp_send: no route to server ip address.
udp_client thread:
struct sockaddr_in si_other;
int s;
socklen_t slen = sizeof(si_other);
char message[64];
char serv_addr[] = "192.168.3.1";
int PORT = 1264;
if ( (s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
{
puts("socket failed");
return;
}
memset((char *) &si_other, 0, sizeof(si_other));
si_other.sin_family = AF_INET;
si_other.sin_port = htons(PORT);
if (inet_aton(serv_addr , &si_other.sin_addr) == 0)
{
fprintf(stderr, "inet_aton() failed\n");
return;
}
while(1)
{
sprintf(message, "Hello from TI client");
//send the message
if (sendto(s, message, strlen(message) , 0 , (struct sockaddr *) &si_other, slen)==-1)
{
puts("sendto() failed");
return;
}
}
Note: I have disabled all the apps from the config file,
#define LWIP_CHARGEN_APP 0
Also added this to the test.c,