private void startListenerThread()
    {
        new Thread(){
            
            @Override
            public void run()
            {
                String packetData = null;
                RadiogramConnection dgConnection = null;
                DatagramConnection dgSendConnection = null;
                Datagram dg = null;
                Datagram dgSend = null;
                
                try
                {
                    dgConnection = (RadiogramConnection) Connector.open("radiogram://:37");
                    // Then, we ask for a datagram with the maximum size allowed
                    dg = dgConnection.newDatagram(dgConnection.getMaximumLength());
                }
                catch (IOException e)
                {
                    System.out.println("Could not open radiogram receiver connection");
                    e.printStackTrace();
                    return;
                }
                
                while ( true )
                {
                    try
                    {
                        dg.reset();
                        dgConnection.receive(dg);
                        packetData = dg.readUTF();
                        String foreignMacAddress = dg.getAddress();
                        if ( foreignMacAddress != null ) // Verify datagram address, there's something odd here
                        {
                            System.out.println("Received: [" + packetData + "] from [" + dg.getAddress() + "]");
                            Packet p = Protocol.Deserialize(packetData);
                            if ( p != null )
                            {
                                // Valid packet format
                                String destination = p.getDestination();
                                String opcode = p.getOpcode(); // Comment if opcode is not valid to use
                                if ( destination.equals(HostAddress) )
                                {
                                    if ( opcode.equals(Protocol.OPCODE_INVITE_REQUEST) )
                                    {
                                        // New device wanting to enter the net
                                        String newIpAddress = generateNewIp(foreignMacAddress);

                                        dgSendConnection = (DatagramConnection) Connector.open("radiogram://" + dg.getAddress() + ":37");
                                        // Then, we ask for a datagram with the maximum size allowed
                                        dgSend = dgSendConnection.newDatagram(dgSendConnection.getMaximumLength());
                                        Packet r = new Packet();

                                        // If the MAC Address is already in our list of connected devices, deny the request
                                        // This can happen if the 
                                        if ( newIpAddress != null )
                                        {
                                            r.setOrigin(destination);
                                            r.setDestination(newIpAddress);
                                            r.setOpcode(Protocol.OPCODE_INVITE_ACCEPTED);
                                            r.setData(WelcomeMessage);
                                        }
                                        else
                                        {
                                            r.setOrigin(destination);
                                            r.setDestination("000.000.000.000");
                                            r.setOpcode(Protocol.OPCODE_INVITE_REJECTED);
                                            r.setData("Possible duplicated MAC Address. Please contact your administrator. You owe him/her a beer.");
                                        }

                                        dgSend.writeUTF(Protocol.Serialize(r));
                                        dgSendConnection.close();
                                    }
                                }
                                else if ( opcode.equals(Protocol.OPCODE_INVITE_DISCONECT) )
                                {
                                    removeDevice(foreignMacAddress);
                                }
                            }
                        }
                        else
                        {
                            System.out.println("Received: [" + packetData + "] from [UNKNOWN DEVICE].");
                        }
                    }
                    catch ( IOException e )
                    {
                        System.out.println("Nothing received");
                    }
                }
            }
            
        }.start();
    }