With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
The Grade of the Solution
The Zone Rank of the Expert Providing the Solution
The Number of Author and Expert Comments
The Number of Experts Contributing
The Feedback of the Community
Your Input Matters Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.
If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.
Hi Experts i need some modification in already made that works fine with no error: I have the following code for sender.c #include "assign1.h" #include "sender.h"
extern int sTOr[2]; extern int rTOs[2];
FILE *fp; static FRAME sendFrame;
void sender(char filename[]) { short blockNum = 0; char reply[5];
int checkSOH(char SOH){ return (SOH == 00000001); }
int checkBlockNum(const short blockNum, const short blockNumComp) { short newComp = ~blockNum;
if (newComp == blockNumComp) return 1; // No error
return 0; // Error }
int checkChecksum(char *str, const short checksum) { if (makeChecksum(str) == checksum) return 1; // No error
return 0; // Error }
void makeError() { int n = rand()%3; switch (n) { case 0: rFrame.blockNum = 0; fputs("\nCHANGED BLOCK NUMBER\n", stderr); break; case 1: rFrame.checksum = 0; fputs("\nCHANGED CHECKSUM\n", stderr); break; case 2: rFrame.blockNumComp = 10; fputs("\nCHANGED BLOCK NUMBER COMPLIEMENT\n", stderr); break; } }
The program simulates different errors that the protocol checks for.I need to modify the program so that it implements "time out". Theory: Sender: sends a frame and calls a SIGALRM function and sets the timer for say, 2 seconds. If the sender gets a response within two seconds from the receiver (either "ACK" or "NAK"), turn off the alarm and transmit the next frame. If no response is received, time out function kicks in and retransmits the frame.
Receiver: When it sees an error in transmission, do not send back anything to the sender and this causes the to time out and retransmit. Im new to C language please help me solve my problem