# File lib/core/connection_driver.rb, line 84
    def read
      size = Cproton.pni_connection_driver_read_size(@impl)
      return if size <= 0
      @io.read_nonblock(size, @rbuf) # Use the same string rbuf for reading each time
      Cproton.pni_connection_driver_read_copy(@impl, @rbuf) unless @rbuf.empty?
    rescue Errno::EWOULDBLOCK, Errno::EAGAIN, Errno::EINTR
      # Try again later.
    rescue EOFError         # EOF is not an error
      close_read
    rescue IOError, SystemCallError => e
      close e
    end