Bugfix: socket_recv should return number of bytes