Knocked a few things off the list...

| 0 Comments

The refactoring and testing of The Server Framework code has gone pretty well. It's not complete but at least we have some tests now and the code is broken down into slightly more cohesive lumps...

Once the tests were in place and working we had to integrate the changes with the various projects that use the library; each of these projects pull the library in slightly different directions so the integration took a while. Luckily each project has a black box test that we can run to make sure the server is still behaving as expected...

Now that we have a separate 'connection manager' object for client side socket connections I decided it was time to write a test harness for the OpenSSL server that we have. We usually use our C# server test framework to test our servers but with the SSL server there was no easy (and free) way to establish an SSL connection from C#. We originally used the Mentalis secure sockets library which provided secure versions of the C# TcpClient class amongst other things. Unfortunately the Mentalis code was unstable when being thrashed by multiple threads in our test harness and that meant that our server test was unreliable... The people at Mentalis have recently updated their security library but the new version looks considerably more complex and heavy weight so we were loathe to incorporate it into our test harness... Anyway, today I put together a test in C++ using the connection manager to establish and manage the outgoing connections. The test uses the same OpenSSL code that we use in the server under test and fires a thousand or so connections at the server and then pumps data through it and compares that the data it gets back is the same as the data that it sends; the idea being that we can flush out any subtle threading bugs. The new test works well, is reliable and gives us a little more confidence that the SSL server is robust.

Once that was done I decided to test one of the flexibility points on the socket server by taking the Bluetooth Winsock example code I'd thrown together a while ago and using the server framework to create a bluetooth server. All that was required was for the socket server's CreateListeningSocket() function to be overridden to set up the bluetooth socket correctly and advertise the service and we were away... Now all I need to do is finish that OBEX parser I was working on...

Leave a comment