import os
from socket import socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR

class UnicastSocket(socket):
    # TODO: can have own id?
    def __init__(self, address, port):
        super().__init__(AF_INET, SOCK_DGRAM)
        self.address = address
        self.port = port
        self.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
        if os.name != 'nt':
            from socket import SO_REUSEPORT
            self.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
        self.bind((address, port))

    def __del__(self):
        self.close()

b62b5c23f5d82332df939e1af92b4588ed7f0b9c
<mask token>


class UnicastSocket(socket):
    <mask token>
    <mask token>

<mask token>


class UnicastSocket(socket):

    def __init__(self, address, port):
        super().__init__(AF_INET, SOCK_DGRAM)
        self.address = address
        self.port = port
        self.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
        if os.name != 'nt':
            from socket import SO_REUSEPORT
            self.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
        self.bind((address, port))
    <mask token>

<mask token>


class UnicastSocket(socket):

    def __init__(self, address, port):
        super().__init__(AF_INET, SOCK_DGRAM)
        self.address = address
        self.port = port
        self.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
        if os.name != 'nt':
            from socket import SO_REUSEPORT
            self.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
        self.bind((address, port))

    def __del__(self):
        self.close()

import os
from socket import socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR


class UnicastSocket(socket):

    def __init__(self, address, port):
        super().__init__(AF_INET, SOCK_DGRAM)
        self.address = address
        self.port = port
        self.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
        if os.name != 'nt':
            from socket import SO_REUSEPORT
            self.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
        self.bind((address, port))

    def __del__(self):
        self.close()

import os
from socket import socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR

class UnicastSocket(socket):
    # TODO: can have own id?
    def __init__(self, address, port):
        super().__init__(AF_INET, SOCK_DGRAM)
        self.address = address
        self.port = port
        self.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
        if os.name != 'nt':
            from socket import SO_REUSEPORT
            self.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
        self.bind((address, port))

    def __del__(self):
        self.close()
