Hi all

I wanted to 

        result = saMsgQueueOpen (handle,
                &queue_name,
                &creation_attributes,
                SA_MSG_QUEUE_CREATE | SA_MSG_QUEUE_RECEIVE_CALLBACK,
                SA_TIME_END,
                &queue_handle);

and then rely on the callback to tell me when I had a new message.

But SA_MSG_QUEUE_RECEIVE_CALLBACK looks like it is not implemented.
Is this not a very common usage? How else are you supposed to know when
there are messages in your queue?

Attached are two test c files (and a make patch) of what I am trying
to do (note they are hacks of Steve's testmsg.c).

Basically I want to send a message to a queue from one process and get it 
delivered 
to another process.

in one shell:
./test/msgprint


in another:
./test/msgsend

Any ideas of how else I can do this with the current saMsg?

Thanks
-Angus



diff --git a/Makefile b/Makefile
index f4a04e8..486a68c 100644
--- a/Makefile
+++ b/Makefile
@@ -42,6 +42,7 @@ include $(srcdir)/Makefile.inc
 INCLUDEDIR=$(PREFIX)/include/openais
 MANDIR=$(PREFIX)/share/man
 SBINDIR=$(PREFIX)/sbin
+BINDIR=$(PREFIX)/bin
 ETCDIR=/etc
 ARCH=$(shell uname -p)
 
@@ -163,6 +164,8 @@ install: all
 
        install -m 755 $(builddir)services/*lcrso $(DESTDIR)$(LCRSODIR)
        install -m 755 $(builddir)services/openais-instantiate 
$(DESTDIR)$(SBINDIR)
+       install -m 755 $(builddir)test/msgsend $(DESTDIR)$(BINDIR)
+       install -m 755 $(builddir)test/msgprint $(DESTDIR)$(BINDIR)
 
        if [ ! -f $(DESTDIR)$(ETCDIR)/ais/openais.conf ] ; then            \
                install -m 644 $(srcdir)conf/openais.conf 
$(DESTDIR)$(ETCDIR)/ais ; \
diff --git a/test/Makefile b/test/Makefile
index f9e5133..c1dc85f 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -42,13 +42,13 @@ endif
 
 LIBRARIES= ../lib/libSaCkpt.a ../lib/libSaMsg.a ../lib/libSaEvt.a sa_error.o
 LIBS = $(LIBRARIES) 
-BINARIES= testckpt testmsg testmsg2 testmsg3 testevt
+BINARIES= testckpt testmsg testmsg2 testmsg3 testevt msgsend msgprint
 
 override CFLAGS += -I../include
 override LDFLAGS += -L../lib
 
 EXTRA_CFLAGS = -I$(srcdir)include
-TEST_SRC = testckpt.c
+TEST_SRC = $(addsuffix .c,$(BINARIES))
 
 all: $(BINARIES)
 
@@ -64,6 +64,12 @@ testmsg2: testmsg2.o $(LIBRARIES)
 testmsg3: testmsg3.o $(LIBRARIES)
        $(CC) $(LDFLAGS) -o testmsg3 testmsg3.o $(LIBS)
 
+msgsend: msgsend.o $(LIBRARIES)
+       $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
+
+msgprint: msgprint.o $(LIBRARIES)
+       $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
+
 testevt: testevt.o $(LIBRARIES)
        $(CC) $(LDFLAGS) -o testevt testevt.o $(LIBS)
 clean:

Attachment: msgprint.c
Description: Binary data

Attachment: msgsend.c
Description: Binary data

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to