To compile and link the files set your environment in the same way as you do to build OpenAMQ server and do the following:
$ c -l im_sender.c Compiling im_sender... Linking im_sender... $ c -l im_receiver.c Compiling im_receiver... Linking im_receiver...
To run the whole thing, you have to start OpenAMQ server first:
Once the server is running you can run chatroom window this way:
$ im_receiver <broker-address> <chatroom>
$ im_receiver localhost:5672 "OpenAMQ discussion"
To send messages to the chatroom, you have to run sender window this way:
$ im_sender <broker-address> <chatroom> <your-name>
$ im_sender 127.0.0.1:5672 "OpenAMQ discussion" "Baron Bartholomaeus von Saburg-Fridetzki"
There can be any number of clients connected to the same chatroom. There's no need to create chatrooms explicitly; these are created on demand.
- Contact author for support.
Following example uses single exchange ("amq.direct") to pass messages. Chatroom is identified by "routing key":
Following example uses separate exchanges of "fanout" type for individual chatrooms: