summaryrefslogtreecommitdiff
path: root/mcastseed/src/mcastseed.c
diff options
context:
space:
mode:
Diffstat (limited to 'mcastseed/src/mcastseed.c')
-rw-r--r--mcastseed/src/mcastseed.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/mcastseed/src/mcastseed.c b/mcastseed/src/mcastseed.c
index da73353..f86af84 100644
--- a/mcastseed/src/mcastseed.c
+++ b/mcastseed/src/mcastseed.c
@@ -264,15 +264,22 @@ int start_job() {
int send_data() {
ssize_t nwrite;
- char buf[] = "dataXXXXXXJe suis à la plage.";
- int paylen = strlen(buf)-10;
+ char buf[] = "dataXXXXJe suis à la plage.";
+ int paylen = strlen(buf)-8;
int seq = 1;
- //FIXME use http://troydhanson.github.io/tpl/index.html
+ //XXX Dummy
+ *( (uint32_t *) buf+1 ) = htonl(3);
+ sendto(mcast_sock, buf, 8+paylen, 0, mcast_addr->ai_addr, mcast_addr->ai_addrlen);
+ *( (uint32_t *) buf+1 ) = htonl(4);
+ sendto(mcast_sock, buf, 8+paylen, 0, mcast_addr->ai_addr, mcast_addr->ai_addrlen);
+ *( (uint32_t *) buf+1 ) = htonl(2);
+ sendto(mcast_sock, buf, 8+paylen, 0, mcast_addr->ai_addr, mcast_addr->ai_addrlen);
+
+
*( (uint32_t *) buf+1 ) = htonl(seq);
- *( (uint16_t *) buf+4 ) = htons(paylen);
- nwrite = sendto(mcast_sock, buf, 10+paylen, 0, mcast_addr->ai_addr, mcast_addr->ai_addrlen);
+ nwrite = sendto(mcast_sock, buf, 8+paylen, 0, mcast_addr->ai_addr, mcast_addr->ai_addrlen);
if ( nwrite < 0 ) {
perror("sendto() failed");
return -1;