def _build_and_send_init(self):
"""Build and send the INIT message"""
# Build the message
msg_bytes = bytearray(12)
struct.pack_into('>III', msg_bytes, 0,
1, # Type - ACK
0, # Remote Channel
self.local_channel # Local channel
)
# Send it to the remote
self._owner.send_data(msg_bytes, (self._remote_ip, self._remote_port))
self._num_init_sent += 1
# Print log
logging.info('%s Sent INIT message (%s)', self, self._num_init_sent)
评论列表
文章目录