Mercurial > hg > beaglert
diff resources/network/udp-server.c @ 132:e24c531220ee scope-refactoring
Added some sort of synchronization, not working great though
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Thu, 27 Aug 2015 01:42:04 +0100 |
parents | fb56681ab1d6 |
children |
line wrap: on
line diff
--- a/resources/network/udp-server.c Wed Aug 26 02:02:10 2015 +0100 +++ b/resources/network/udp-server.c Thu Aug 27 01:42:04 2015 +0100 @@ -48,11 +48,11 @@ if (n < 0) error("recvfrom"); printf("Received a datagram of size %d: \n", n); printf("Header: channel: %d, timestamp: %d\n", (int)buf[0], (int)buf[1]); - for(i=2; i<n/sizeof(float); i+=8) - printf("%+f, %+f, %+f, %+f, %+f, %+f, %+f, %+f\n",i,buf[0+i],buf[1+i],buf[2+i],buf[3+i],buf[4+i],buf[5+i],buf[6+i],buf[7+i]); - n = sendto(sock,"Got your message\n",17, - 0,(struct sockaddr *)&from,fromlen); - if (n < 0) error("sendto"); + // for(i=2; i<n/sizeof(float); i+=8) + // printf("%+f, %+f, %+f, %+f, %+f, %+f, %+f, %+f\n",buf[0+i],buf[1+i],buf[2+i],buf[3+i],buf[4+i],buf[5+i],buf[6+i],buf[7+i]); + // n = sendto(sock,"Got your message\n",17, + // 0,(struct sockaddr *)&from,fromlen); + // if (n < 0) error("sendto"); } return 0; }