Fix receive bug.  Add timeout parameter to poll function.