public void sendData(String data) {
            DatagramPacket packet = new DatagramPacket(data.getBytes(), data.getBytes().length, ipaddress, port);
            try {
                socket.send(packet);
            } catch (IOException e) {
                e.printStackTrace();
            }
        
    }