As part of my BSc third year project, I constructed a desktop application which allowed data streams to be routed and forwarded effortlessly around a PC. This is amongst the most complex pieces of software I've worked on and was awarded distinction status by the university.
The program could communicate with various different inputs and outputs, such as USB and serial ports, and also network ports with either TCP or UDP, running as a server or client. The program linked these various ports together, and allowed data to stream fluidly between them. As an example, the program could be set up so that various TCP or UDP network ports could be opened, with incoming data being mixed together and then outputted to a serial port.
Architecturally, the program could handle port errors or crashes because of its inherently safe design. Each port was assigned its own dedicated thread which could operate independently. Therefore the program was designed to have many different threads running and could synchronise communication between them dynamically. This allowed for the outward port communication to be blocking
, pushing down the CPU usage of the program to next to nothing.
The software was designed with cross-platform use in mind, and could run under Windows, and Ubuntu and Fedora Linux. The project included a suite of testing and diagnostic tools, which simulated the various different types of ports, fed in dummy data, and would occasionally simulate problems such as corrupt data, connection loss, and the port hanging or crashing.