Exemple #1
0
    def serialize(self):
        payload = str(self.chunk_id)
        payload += P.PAYLOAD_FIELD_SEPARATOR
        payload += str(self.total_chunks)
        payload += P.PAYLOAD_FIELD_SEPARATOR
        payload += self.chunk

        header = P.construct_header(P.DOCUMENT_DOWNLOAD, len(payload))

        return header + payload
Exemple #2
0
    def serialize(self):
        payload = self.option
        payload += P.PAYLOAD_FIELD_SEPARATOR
        payload += str(self.row_start)
        payload += P.PAYLOAD_FIELD_SEPARATOR
        payload += str(self.row_end)
        payload += P.PAYLOAD_FIELD_SEPARATOR
        payload += self.text

        header = P.construct_header(P.UPDATE_TEXT, len(payload))

        return header + payload
Exemple #3
0
    def serialize(self):
        payload = self.file_name
        header = P.construct_header(P.DOCUMENT_REQUEST, len(payload))

        return header + payload
Exemple #4
0
    def serialize(self):
        payload = self.c_name
        header = P.construct_header(P.INTRODUCTION, len(payload))

        return header + payload
Exemple #5
0
 def serialize(self):
     payload = str(self.response)
     header = P.construct_header(P.REQUEST_RESPONSE, len(payload))
     return header + payload