modified for termination when used for mictcp video replay
This commit is contained in:
parent
769f757fec
commit
dc7fb0af27
1 changed files with 9 additions and 5 deletions
|
@ -241,9 +241,10 @@ void file_to_mictcp(struct sockaddr_in listen_on, struct sockaddr_in transmit_to
|
|||
struct timespec currentTime;
|
||||
struct timespec rem;
|
||||
int firstValue = 0;
|
||||
int active = 1;
|
||||
|
||||
// Main activity loop, we never exit this, user terminates with SIGKILL
|
||||
while(1) {
|
||||
// Main activity loop, we exit this at the end of the file
|
||||
while(active) {
|
||||
bzero(buffer, MAX_UDP_SEGMENT_SIZE);
|
||||
|
||||
n = fread(¤tTimeFile, 1, sizeof(struct timespec), fd);
|
||||
|
@ -266,8 +267,11 @@ void file_to_mictcp(struct sockaddr_in listen_on, struct sockaddr_in transmit_to
|
|||
lastTimeFile = currentTimeFile;
|
||||
n = fread(buffer, 1, sizeof(n), fd);
|
||||
n = fread(buffer, 1, *((int *)buffer), fd);
|
||||
if (n < 0) {
|
||||
perror(0);
|
||||
if (n <= 0) {
|
||||
if(n < 0) {
|
||||
perror(0);
|
||||
}
|
||||
active = 0;
|
||||
}
|
||||
|
||||
// We forward the packet to its final destination
|
||||
|
@ -277,7 +281,7 @@ void file_to_mictcp(struct sockaddr_in listen_on, struct sockaddr_in transmit_to
|
|||
}
|
||||
}
|
||||
|
||||
// We never execute this but anyway, for sanity
|
||||
// We execute this when the file has finished being replayed
|
||||
close(listen_sockfd);
|
||||
|
||||
// Same for MICTCP
|
||||
|
|
Loading…
Reference in a new issue