Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "mynew.h"
- #include "tcp.h"
- TCP::TCP(int numPort)
- {
- const Port notFound = {0, NULL, 0};
- pt = new PortTable(notFound, 2 * numPort);
- } // TCP()
- TCP::~TCP() {
- }
- // helper function
- static void insertIntoPort(int destPackNum, char *data, Packet* head)
- {
- Packet* current = head;
- while (destPackNum >= current->packetNumber && current->next != NULL) {
- current = current->next;
- }
- Packet* np = new Packet(destPackNum, data, current->next);
- current->next = np;
- }
- void TCP::receive(int portNum, int packetNum, const char packet[257])
- {
- } // receive()
- int TCP::getStream(int portNum, char stream[100000])
- {
- // getStream() should fill the stream with current packets that have
- // packet numbers greater than the last packet past in the last
- // stream for this port. The packets must be ascending order, though
- // not necessarily consecutive. Return the size of the stream in bytes.
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement