'Send data to client, return any unsent data.'

def send(self, data):

    try:
        sent = self.sock.send(data)
        return data[sent:]
    except socket.error as e:
        if (e.errno in (errno.EWOULDBLOCK, errno.EINTR)):
            return data
        self.stop((u'Unexpected    client    error:    %s' % encoding.locale_decode(e)))
        return ''
