This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# receiver.py | |
# | |
# Go-Back-N simulation based on the RDT 2.2 protocol described in | |
# section 3.4.1 of Computer Networking: A Top-Down Approach, Kurose-Ross, 7th edition | |
# | |
import sys | |
from sm import StateMachine | |
import rdtlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<h1>My Website</h1> | |
<p>Some text...</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void copy_loader() { | |
int dev_addr = START_ADDR; | |
char *mem_addr = (char *) malloc(length * sizeof(char)); | |
for(int i = 0; i < LOADER_LEN; i++) { | |
char *byte = dev_read_byte(dev_addr, mem_addr); | |
dev_write_byte((int) mem_addr, byte); | |
dev_addr++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
const int CW_TIME = 10000000; | |
// Threaded task | |
void *childsWork(void *param) { |