Hello guys
This is a packet that I have to send to another application..
This is supposed to be a buffer of packets, an array of packets:Code:#define M_PKT_SIZE 1400 // max dimension of a packet // a packet has a size and a data typedef struct aPacket { int pkt_length; char data[M_PKT_SIZE]; } Packet;
Here I've received a packet form the local application and before sending it through the wire, I put it in the packet buffer (window)..Code:// array of packets, it is the window Packet window[MAX_WINDOW_SIZE];
ERROR: invalid type argument of `->'Code:int r_send(const char * pkt, int pktlen) { ... window[nextSequenceNumber % BUFFER_LENGTH]->pkt_length = buflen; strcpy(window[nextSequenceNumber % BUFFER_LENGTH]->data, buf);[/ ...
Then the same..when I have the packet in the buffer and i want to send it..
ERROR: invalid type argument of `->'Code:u_send (window[i % MAX_WINDOW_SIZE]->data, window[i % MAX_WINDOW_SIZE]->pkt_length);
How can I fix this? Do I have to allocate memory before to store the packet in the packet buffer (window)? Isn't the memory allocated before because it is in an array?
Thanx



LinkBack URL
About LinkBacks



