throwaway9870
Joined 8 years ago
Joined 8 years ago
> assert(data_buf[4] < 8);
While your protocol might guarantee that data_buf[4] should always be a value less than 8, you don't use assert() to check it because it aborts the program if the check fails. The proper thing to do is a range check that returns an error for a protocol error (malformed data, etc.).
ZeroMQ literally called assert and any bad data coming in over the wire would cause your app to abort. Insane.
Here is an example bug report:
https://github.com/zeromq/libzmq/issues/186
Keep in mind this was a LONG time ago! So this is not an indictment of the current project!
I have manufactured in that area and while you are not going to be in the mass volume pricing levels, you don't have to be in the defense level either. You just have to build the product with the right trade-offs and design the appropriate manufacturing processes. Few seem to know how to do this.
Edit: let me expand. Don't injection mold if you can avoid it. Do resin castings or thermo-forming, neither require as expensive of tooling. 3D print parts with a good material like PC CF. Metal fabrication is easy and cheap these days. You can get a shop to laser cut, form, insert PEMs and powder coat for very reasonable prices. We are starting to get a lot of machined parts from China. You can source wire harnesses from China also. Do assembly with a small team. Use as much off-the-shelf electronics as possible, but don't be afraid to make small and simple PCBs if it makes your product cheaper and simpler. Leave the complex boards to a vendor initially because while they might seem simple to design, they can be complex to debug and production test properly.
IIRC, their interfaces were used in some Sony play-stations and also some Intel systems.