@SuppressWarnings("InfiniteLoopStatement")
    @Override
    public void run() {
        while(true){
            try {
                DatagramPacket received=new DatagramPacket(ByteBuffer.allocate(Message.MessageSizeProperties.FULL_MESSAGE_SIZE).array(),Message.MessageSizeProperties.FULL_MESSAGE_SIZE);
                Message message;
                socket.receive(received);
                try {
                    message = new Message(received.getData());
                    if(!message.getLogin().equals(login))
                        System.out.println(message.toString());
                } catch (NoSuchAlgorithmException e) {
                    e.printStackTrace();
                } catch (IllegalArgumentException e) {
                    System.out.println(e.getMessage());
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }