Commit a814a35b authored by Andreas Schmidt's avatar Andreas Schmidt

Set sequence number upon acceptance of payload for application.

parent 40464d0a
Pipeline #821 passed with stages
in 57 seconds
......@@ -71,12 +71,11 @@ void *send_data_loop(void *ptr)
"Cond wait failed.");
}
PrrtPacket *packet = List_shift(sock_ptr->outQueue);
if(block == NULL) {
block = PrrtBlock_create(sock_ptr->codingParams, sock_ptr->sequenceNumberSource);
block = PrrtBlock_create(sock_ptr->codingParams, packet->sequenceNumber);
}
PrrtPacket *packet = List_shift(sock_ptr->outQueue);
packet->sequenceNumber = sock_ptr->sequenceNumberSource++;
packet->index = (uint8_t) (packet->sequenceNumber - block->baseSequenceNumber);
PrrtPacketDataPayload *payload = packet->payload;
......
......@@ -122,7 +122,7 @@ int PrrtSocket_connect(PrrtSocket *sock_ptr, const char *host, const uint16_t po
int PrrtSocket_send(PrrtSocket *sock_ptr, const uint8_t *data, const size_t data_len) {
check(sock_ptr->isSender, "Cannot send on receiver socket.")
PrrtPacket *packet = PrrtPacket_create_data_packet(5, data, (prrtPacketLength_t) data_len, 0, PrrtApplicationConstraints_get_target_delay(sock_ptr->applicationConstraints));
PrrtPacket *packet = PrrtPacket_create_data_packet(5, data, (prrtPacketLength_t) data_len, sock_ptr->sequenceNumberSource++, PrrtApplicationConstraints_get_target_delay(sock_ptr->applicationConstraints));
check(pthread_mutex_lock(&sock_ptr->outQueueFilledMutex) == 0, "Lock failed.");
List_push(sock_ptr->outQueue, packet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment