Fix wrong receive size and add TIMEOUT constant