flushing object ostream, wrote mockclient to test server