This file contains hidden or 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
| export PROMPT_COMMAND=__git_prompt | |
| __git_prompt () | |
| { | |
| txtblk='\e[0;30m' # Black - Regular | |
| txtred='\e[0;31m' # Red | |
| txtgrn='\e[0;32m' # Green | |
| txtylw='\e[0;33m' # Yellow | |
| txtblu='\e[0;34m' # Blue | |
| txtpur='\e[0;35m' # Purple | |
| txtcyn='\e[0;36m' # Cyan |
This file contains hidden or 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
| export PROMPT_COMMAND=__git_prompt | |
| __git_prompt () | |
| { | |
| txtblk='\e[0;30m' # Black - Regular | |
| txtred='\e[0;31m' # Red | |
| txtgrn='\e[0;32m' # Green | |
| txtylw='\e[0;33m' # Yellow | |
| txtblu='\e[0;34m' # Blue | |
| txtpur='\e[0;35m' # Purple | |
| txtcyn='\e[0;36m' # Cyan |
This file contains hidden or 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
| // | |
| // Majordomo Protocol worker example | |
| // Uses the mdwrk API to hide all MDP aspects | |
| // | |
| // Lets us 'build mdworker' and 'build all' | |
| #include "mdwrkapi.c" | |
| int main (void) | |
| { | |
| mdwrk_t *session = mdwrk_new ("tcp://localhost:5555", "echo", 1); |
This file contains hidden or 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
| // | |
| // Hello World server | |
| // Binds REP socket to tcp://*:5555 | |
| // Expects "Hello" from client, replies with "World" | |
| // | |
| // Changes for 2.1: | |
| // - added socket close before terminating | |
| // | |
| #include <zmq.h> | |
| #include <stdio.h> |
This file contains hidden or 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
| // | |
| // Client-side pirate | |
| // Use zmq_poll to do a safe request-reply | |
| // To run, start hwserver and then randomly kill/restart it | |
| // | |
| #include "zhelpers.h" | |
| #define REQUEST_TIMEOUT 2500 // msecs | |
| #define REQUEST_RETRIES 3 // Before we abandon |
This file contains hidden or 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
| // | |
| // Socket leak test case | |
| // | |
| #include "zhelpers.h" | |
| int main () { | |
| void *context = zmq_init (1); | |
| // Open socket, send message, close socket |
This file contains hidden or 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
| // | |
| // Leak example using PUB/SUB pattern | |
| // | |
| // While this example runs in a single process, that is just to make | |
| // it easier to start and stop the example. Each task has its own | |
| // context and conceptually acts as a separate process. | |
| #include "zhelpers.h" | |
| #include "zmsg.c" |
This file contains hidden or 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
| // | |
| // Leak example using PUB/SUB pattern | |
| // | |
| // While this example runs in a single process, that is just to make | |
| // it easier to start and stop the example. Each task has its own | |
| // context and conceptually acts as a separate process. | |
| #include "zhelpers.h" | |
| #include "zmsg.c" |
This file contains hidden or 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
| // | |
| // Multithreaded relay | |
| // | |
| // Changes for 2.1: | |
| // - added version assertion | |
| // - pass context & thread to child threads | |
| // - create socket pair for inproc communications | |
| // - close sockets in each child thread | |
| // | |
| #include "zhelpers.h" |
This file contains hidden or 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
| // | |
| // Synchronized publisher | |
| // | |
| // Changes for 2.1: | |
| // - added version assertion | |
| // - close syncservice socket in main thread | |
| // - removed sleep(1) at end of main thread | |
| // | |
| #include "zhelpers.h" |