Code example for DatagramSocket

Methods: isClosed

0
    public boolean isClosed() { 
        boolean b;
        if (socket == null) {
            b = false;
        } else { 
            b = socket.isClosed();
        } 
        return b;
    } 
 
    public void broadcast(Object message) throws MessageException {
        try { 
            byte[] buf = new byte[paketSize];
            byte[] tempbuf = Serializer.serialize(message);
            if (tempbuf.length > paketSize) {
                throw new MessageException("Message exceeds limit."); 
            } else { 
                buf = tempbuf;
            } 
 
            DatagramPacket packet;