Adventures with \Device\Afd - a simple client

Now that I have a reasonably easy to use event-driven socket class I can start to use it. The first thing to build is a simple client. This will connect to a server and expect that server to echo anything that is sent to it. The client will send data and read it back and compare it with what it sent. A simple, single-threaded, client Last time, I put together a tcp_socket object that made it easier to work with the \Device\Afd interface that I’ve been playing with.

Adventures with \Device\Afd - test driven design

I’ve been investigating the ‘sparsely documented’ \Device\Afd interface that lies below the Winsock2 layer. Today I use a test-driven method for building some code to make using this API a little easier. Using the API In my previous posts on the \Device\Afd interface I focused on exploring and understanding the API itself. Since it’s ‘sparsely documented’ I used unit tests to explore and record my findings. This has left me with some code that is easy to come back to and pick up, which is lucky since it’s been quite a while since I last had some time to tinker with it.

Merging L'Hexapod's content...

Back in 2009 I started playing around with embedded assembly language on simple hardware with the intention of building a robot spider. This was hosted on a separate website, L’Hexapod.com It was a lot of fun but once my children came along the project took up too much time for me to focus on it. Back in 2010 I thought that the birth of my first son, Scott, would be just a small blip in my journey into robotics but, looking back, it seems to have been the end of that chapter.

JetByte News: 2024

2023 was a good year. We finished off a project for our Industrial Control Client and everyone seems happy, which is always nice. Our work with the secretive Online Gaming Company is taking up most of our time as we continue to enhance the cloud gaming server that we wrote for them. They continue to go from strength to strength, which is good. We have been rolling out a series of changes into their live environment and increasing test coverage and our ability to test and debug using light-weight journals of communication sessions.

JetByte News: Long distance debugging

We’ve now reached the end of the recent embedded development project for our Industrial Control Client. The final phase was made more complicated by the difficulty in debugging the changes. The embedded hardware had no screen, and the network debug facility that it supported was unreliable; it sometimes just lost messages. So the first step was to work around this issue with some debug messages in-line with the normal TCP/IP data channel from the hardware.

How little things kick you out of the zone

I had an internet outage this morning. This shouldn’t have been much of a problem for me as all of the code that I needed to be working on is on my local git server and all of the dependencies are local. Or so I thought. The client has a c# shim layer that builds as part of the C++ server build. They rely on NuGet to grab some components from somewhere for some reason.

JetByte News: Punch card programming...

The second of our “reanimation” projects has reached a significant milestone. We ran the whole new system on the real hardware last week, and it mostly works. This is a big step for us and the client as the project has been quite complex in terms of how the development has been done. As I said, our secret Industrial Control Client has had us working on a program that compiles in Visual C++ 6 on an XP VM.

Setting the preferred NUMA node for a Windows Service (and making it work after a reboot)

When your machine has multiple NUMA nodes it’s often useful to restrict a process to using just one for performance reasons. It’s sometimes hard to fully utilize multiple NUMA nodes and, if you get it wrong, it can cost in performance as the nodes need to keep their caches consistent and potentially access memory over a slower link than the memory that is closer to the node, these things can be relatively expensive.

JetByte News: Reanimator!

We recently had an old client contact us with an unusual request. We last worked with VEXIS Systems Inc. back in 2010 when we extended the telephony server we’d built for them to support CLR hosting, using The Server Framework’s CLR Hosting Option. We then built a managed plugin system that integrated with the existing unmanaged system so that they could write their business logic in either unmanaged code or in a managed language such as C#.

Multi-threaded testing

I’ve always found testing multi-threaded code in C++ a humbling experience. It’s just so easy to make stupid mistakes and for those mistakes to lurk in code until the circumstances are just right for them to show themselves. This weekend a unit test that has run thousands of times for many years started to fail. The reason for the failure was a fairly obvious race condition in the test code. This issue had lain dormant and only been exposed by running the tests on my new development machine.