def send_packet(self, data):
    self._sock.connect(self.peer)
    p = NetBIOSUDPSessionPacket()
    p['ID'] = self.next_id()
    p['SourceIP'] = self._sock.getsockname()[0]
    p['SourceName'] = encode_name(self.get_myname(), self.get_mytype(), '')[:(- 1)]
    p['DestinationName'] = encode_name(self.get_remote_name(), self.get_remote_type(), '')[:(- 1)]
    p['Data'] = data
    self._sock.sendto(str(p), self.peer)
    self._sock.close()
    self._sock = self._setup_connection(self.peer)
def send_packet(self, data):
    self._sock.connect(self.peer)
    p = NetBIOSUDPSessionPacket()
    p['ID'] = self.next_id()
    p['SourceIP'] = self._sock.getsockname()[0]
    p['SourceName'] = encode_name(self.get_myname(), self.get_mytype(), )[:(- 1)]
    p['DestinationName'] = encode_name(self.get_remote_name(), self.get_remote_type(), )[:(- 1)]
    p['Data'] = data
    self._sock.sendto(str(p), self.peer)
    self._sock.close()
    self._sock = self._setup_connection(self.peer)