User Datagram Protocol sender and receiver

def _dgram_send_and_receive(self, _socket, message, buffer_size=4096, *args):
        """User Datagram Protocol sender and receiver"""
        _socket.send(message.encode('utf-8'))
        data, address = _socket.recvfrom(buffer_size)
        return BytesIO(data)