use optional<milliseconds> for timeout values. fixes many cases where timeout was being passed as flags to sendto/recvfrom