The following section, reading data one byte at a time, is very slow when trying to handle MB-order packets.
|
unless recv_data = @socket.getc |
|
sleep 1 |
|
next |
|
end |
Simply replace with the following to speed up the process. I didn't make a pull request because I wasn't sure what to specify as a buffer size, but I hope you will consider replacing it.
recv_data = @socket.readpartial(4096*16)