forked from zeromq/filemq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from BHare1985/zproject-skeletons
Regenerate .c and .h
- Loading branch information
Showing
12 changed files
with
292 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,64 @@ | ||
/* ========================================================================= | ||
filemq_server - Very simple server | ||
Copyright (c) the Contributors as noted in the AUTHORS file. | ||
This file is part of FileMQ, a C implemenation of the protocol: | ||
https://github.com/danriegsecker/filemq2. | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
========================================================================= | ||
*/ | ||
|
||
/* | ||
@header | ||
filemq_server - Very simple server | ||
@discuss | ||
@end | ||
*/ | ||
|
||
#include "filemq_classes.h" | ||
|
||
int main (int argc, char *argv []) | ||
{ | ||
zactor_t *server; | ||
if (argc < 2) { | ||
puts ("usage: filemq_server publish-from"); | ||
return 0; | ||
bool verbose = false; | ||
int argn; | ||
for (argn = 1; argn < argc; argn++) { | ||
if (streq (argv [argn], "--help") | ||
|| streq (argv [argn], "-h")) { | ||
puts ("filemq_server publish-from [options] ..."); | ||
puts (" --verbose / -v verbose test output"); | ||
puts (" --help / -h this information"); | ||
return 0; | ||
} | ||
else | ||
if (streq (argv [argn], "--verbose") | ||
|| streq (argv [argn], "-v")) | ||
verbose = true; | ||
else { | ||
printf ("Unknown option: %s\n", argv [argn]); | ||
return 1; | ||
} | ||
} | ||
|
||
zactor_t *server; | ||
server = zactor_new (fmq_server, "filemq_server"); | ||
|
||
//zstr_send (server, "VERBOSE"); | ||
if (verbose){ | ||
zsys_info ("filemq_server - Very simple server"); | ||
zstr_send (server, "VERBOSE"); | ||
} | ||
|
||
zstr_sendx (server, "PUBLISH", argv [1], "/", NULL); | ||
zstr_sendx (server, "BIND", "tcp://*:5670", NULL); | ||
|
||
while (!zsys_interrupted) | ||
zclock_sleep (1000); | ||
|
||
puts ("interrupted"); | ||
|
||
zactor_destroy (&server); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.