<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def piper(self, in_sock, out_sock, out_addr, onkill):
        "Worker thread for data reading"
        try:
            while True:
                written = in_sock.recv(32768)
                if not written:
                    try:
                        out_sock.shutdown(socket.SHUT_WR)
                    except socket.error:
                        self.threads[onkill].kill()
                    break
                try:
                    out_sock.sendall(written)
                except socket.error:
                    pass
                self.data_handled += len(written)
        except greenlet.GreenletExit:
            return