Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/littlstar/libgossip
Message queueing in Objective-C without Foundation dependency
https://github.com/littlstar/libgossip
Last synced: about 1 month ago
JSON representation
Message queueing in Objective-C without Foundation dependency
- Host: GitHub
- URL: https://github.com/littlstar/libgossip
- Owner: littlstar
- License: mit
- Created: 2014-09-19T13:04:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-25T19:23:44.000Z (over 10 years ago)
- Last Synced: 2023-05-29T11:01:18.618Z (over 1 year ago)
- Language: Objective-C
- Size: 271 KB
- Stars: 9
- Watchers: 24
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
libgossip
=========Message queueing in Objective-C without Foundation dependency
## install with clibs
```sh
$ [sudo] clib install jwerle/libgossip
```## building from source
```sh
$ ./configure
$ make
$ make check
$ [sudo] make install
```## system requirements
* clang
* llvm
* make
* ar
* libnanomsg
* libobjc >= 3
* libBlocksRuntime (Linux only)## documentation
TODO...
## example
**server.m**
```objc
#import
#importint
main (int argc, char **argv) {
if (argc == 1) { return 1; }
GossipPipe *pipe = GossipPipe.new;
pipe.protocol = GossipSocket.PULL;
[pipe open];
[pipe bind: argv[1]];
while (1) {
[pipe pull: ^(void *data, size_t size) {
char *buf = (char *) data;
buf[size] = 0;
printf("GOT: %s\n", buf);
}];
[pipe close];
}
return 0;
}
```**client.m**
```objc
#import
#importint
main (int argc, char **argv) {
if (3 != argc) { return 1; }
GossipPipe *pipe = GossipPipe.new;
pipe.protocol = GossipSocket.PUSH;
[pipe open];
printf("connecting to `%s'\n", argv[1]);
[pipe connect: argv[1]];
printf("sending `%s'\n", argv[2]);
[pipe push: argv[2]];
[pipe close];
return 0;
}
```### build and run
```sh
$ cc server.m -lgossip -lobjc -o server
$ cc client.m -lgossip -lobjc -o client
$ ./server tcp://*:8888 &
$ ./client tcp://127.0.0.1:8888 HI
connecting to `tcp://127.0.0.1:8888'
sending `HI'
GOT: HI
$ fg
./server tcp://*:8888
^C
```## license
MIT