package main
// #cgo CFLAGS: -I${SRCDIR}/../salticidae/include/
// #include <stdlib.h>
// #include <arpa/inet.h>
// #include "salticidae/network.h"
// void onTerm(int sig, void *);
// void onReceiveRand(msg_t *, msgnetwork_conn_t *, void *);
// void onReceiveAck(msg_t *, msgnetwork_conn_t *, void *);
// void onStopLoop(threadcall_handle_t *, void *);
// void connHandler(msgnetwork_conn_t *, bool, void *);
// void onTimeout(timerev_t *, void *);
// typedef struct timeout_callback_context_t {
// int app_id;
// uint64_t addr_id;
// msgnetwork_conn_t *conn;
// } timeout_callback_context_t;
// static timeout_callback_context_t *timeout_callback_context_new() {
// timeout_callback_context_t *ctx = malloc(sizeof(timeout_callback_context_t));
// ctx->conn = NULL;
// return ctx;
// }
//
import "C"
import (
"github.com/Determinant/salticidae-go"
"math/rand"
"fmt"
"sync"
"unsafe"
"strconv"
)
const (
MSG_OPCODE_RAND salticidae.Opcode = iota
MSG_OPCODE_ACK
)
func msgRandSerialize(size int) (salticidae