Change the onData event of core.socket to have a return type of a buffer.