'Instantiate a NetBIOS instance, and creates a IPv4 UDP socket to listen/send NBNS packets.
:param boolean broadcast: A boolean flag to indicate if we should setup the listening UDP port in broadcast mode
:param integer listen_port: Specifies the UDP port number to bind to for listening. If zero, OS will automatically select a free port number.'

def __init__(self, broadcast=True, listen_port=0):

    self.broadcast = broadcast
    self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    if self.broadcast:
        self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
    if listen_port:
        self.sock.bind(('', listen_port))
