igrigorik/em-synchrony — Issue #77: EventMachine::Synchrony::TCPServer#read returns partial reads
Author: eliaslevy
Created: 2011-11-01 05:47:08+00:00
State: open

Calls to read with a length parameters should only return a string shorter than requests if the stream's EOF has been reached. See http://www.ruby-doc.org/core-1.9.2/IO.html#method-i-read.

The current read implementation returns as there is any data available, without waiting for enough data as requested. The current behavior is sufficient to emulate recv, but not read. It breaks applications that expect read to wait for enough data to arrive.