Finally got the fcking server working properly, after some serious work associated with buffering.