Simple File Transfer

Overview

Simple file transfer application in C. It is intended as an example of how to send and receive messages via OpenAMQ WireAPI.

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 send_file.c
Compiling send_file...
Linking send_file...
$ c -l receive_file.c
Compiling receive_file...
Linking receive_file...

To run the whole thing, you have to start OpenAMQ server first:

$ amq_server

Once the server is running you can run your file receiver application:

$ receive_file <broker-addeess> <file-name>

For example:

$ receive_file 127.0.0.1:5672 test.txt

To send the message use send_file this way:

$ send_file <broker-addeess> <file-name>

For example:

$ send_file localhost:5672 test.txt

Caution: Do not try to transfer very large files! The example reads the file content into memory prior to sending it. Sending large file can exhaust the memory and cause your system to swap and slow down in considerable manner.

License

BSD

Support

Address all questions and comments to moc.xitami|kirtsus#moc.xitami|kirtsus.

Download

Comments

rating: +2+x