Hi all,
I haven’t had too much luck with responses in this forum, but I really need some help on this one.
Im trying to send and receive over UDP and I have looked at the echo example and the UDP stuff posted in the FAQ on rabbit. I have successfully received over UDP but cannot send. My code relating to the UDP looks like:
#define _PRIMARY_STATIC_IP “192.168.0.14”
#define TCPCONFIG 1
#define MAX_UDP_SOCKET_BUFFERS 2
#define DISABLE_TCP // Not using TCP
#define LOCAL_PORT 54321
#define REMOTE_PORT 12345
sockcheck=sock_init();
if(sockcheck!=0){printf("Socket init failed
");}
//udp_open(&sock,LOCAL_PORT,-1,0,udp_readf);
if(!udp_extopen(&sock, IF_ANY, LOCAL_PORT, -1, 0, udp_readf, 0,0)) {
printf("udp_extopen failed!
");
exit(0);
SENDUDPARRAY[3]=velocity_left;
SENDUDPARRAY[5]=velocity_right;
just=udp_sendto(&sock,SENDUDPARRAY,sizeof(SENDUDPARRAY), -1, REMOTE_PORT);
printf("Send status %d
",just);
But the send returns -1 every time. Any idea as to whats wrong?
Thanks in advance.
}