Copied over client.c and fixed it up a bit. Not doing send yet tho