in Education by
I am rewriting code to handle some embedded communications and right now the protocol handling is implemented in a While loop with a large case/switch statement. This method seems a little unwieldy. What are the most commonly used flow control methods for implementing communication protocols? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
It sounds like the "while + switch/case" is a statemachine implementation. I believe that a well thought out statemachine is often the easiest and most readable way to implement a protocol. When it comes to statemachines, breaking some of the traditional programming rules comes with the territory. Rules like "every function should be less than 25 lines" just don't work. One might even argue that statemachines are GOTOs in disguise.

Related questions

0 votes
    While working on the Subversion, what are the various commands which you have used frequently for handling the changes made to the documents?...
asked Feb 18, 2021 in Technology by JackTerrance
0 votes
    The four most frequently used types of data objects in R are vectors, matrices, data frames and ________ (a) ... Out of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Which of these should be eliminated for effective communication * Planning Noise Transparent central protocol active listening Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    In port scanning, a _________ is always associated with an IP address (usually of the host system) & the ... -for-Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Nov 1, 2021 in Education by JackTerrance
0 votes
    ___________________ is employed by encrypting the application layer with a communication protocol stack, nested in ... Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    _____________ is the favored communication protocol among NiFi instances. (1)NiFi Peer-to-Peer (P2P) Protocol (2)NiFi Site- ... Protocol (3)None of the options (4)All the options...
asked Apr 19, 2021 in Technology by JackTerrance
0 votes
    The ______________ hijacking is implemented on the data flow of protocol shared by all web applications. (a) ... -Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    Nowadays, most botnets rely on existing _______________ networks for communication. (a) server-to-server (b) ... -Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Nov 1, 2021 in Education by JackTerrance
0 votes
    Which is the most preferred way of handling events? 1. Referencing an element with the event and assign a function as ... 3. Writing the JavaScript as an attribute to an element...
asked Feb 26, 2021 in Technology by JackTerrance
0 votes
    Bitmaps can be used as a compressed storage mechanism at the leaf nodes of ________ for those values that ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    The ________ gives access to frequently used apps and recent activities. A. Me Area B. Workspace area C. Notification area...
asked Mar 2, 2023 in Technology by JackTerrance
0 votes
    The frequently used buffer replacement strategy is (a) Most recently used (b) Least recently used (c) ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    __________ is increasingly being used in server systems to improve performance by caching frequently used data, ... in portion Storage and File Structures of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    Which of this package is used for handling security related issues in a program? (a) java.security (b) java. ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
...