public boolean write (SocketBase s) 
        {
            int size = 4 + 1 + addr.length () + 1; // event + len(addr) + addr + flag
            if (flag == VALUE_INTEGER)
                size += 4;
            
            ByteBuffer buffer = ByteBuffer.allocate (size);
            buffer.putInt (event);
            buffer.put ((byte) addr.length());
            buffer.put ((byte) flag);
            if (flag == VALUE_INTEGER)
                buffer.putInt ((Integer)arg);

            Msg msg = new Msg (buffer);
            return s.send (msg, 0);
        }