The trusty TCP bridge

8.31.09

Recently trying to link code in Matlab and Python became extremely sticky. From all the alternatives sockets proved to be the fastest and most reliable method of sending data back and forth. The only problem which I encounter every single time I do this (which trust me, it happens often as an entry level research assistant) is that C has very poor socket libraries. It takes more coding to create a C socket then the entire research project.For that reason this time around I invested the time to create a small, efficient and compressed library for socket communication that I can reuse in future projects.

It uses Boost (for pointers) and Zlib (for compression) but otherwise should work in any environment. If you have questions or comments don’t hesitate. (Currently it only works as a client, a possible server may also be implemented in the future)

Download the code: here