Modified the socketSend() due to a bug reading chunk responses. Follows the explanation.

When reading from network streams or pipes, such as those returned when reading remote files or from popen() and proc_open(), reading will stop after a new packet is available. This means that we must collect the data together in chunks. So, we can't pass to the fread() the entire length because it could return less data than expected. We have to read, instead, the standard buffer length, and concatenate the read chunks.