def send_update(self, id, code, code_msg, content=''): id = to_update_id(id) pkt = update_to_packet(id, code, code_msg, content) write_packet(self._connfd, pkt)
def send_request(self, id, req): id = to_request_id(id) pkt = request_to_packet(id, req) write_packet(self._connfd, pkt)
def send_response(self, id, code, code_msg, content=''): id = to_response_id(id) pkt = response_to_packet(id, code, code_msg, content) write_packet(self._connfd, pkt)