diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-24 14:59:39 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-25 08:11:26 -0700 |
| commit | 301de3ac5c7cf8a5eaaf3c58157251db781841d6 (patch) | |
| tree | d0a19062d01de0df130a59613134330809b2a5ae /demo/raw/README.adoc | |
| parent | b36dadf267842fb2fad7596f90f8f0cd78ac4af5 (diff) | |
| download | nng-301de3ac5c7cf8a5eaaf3c58157251db781841d6.tar.gz nng-301de3ac5c7cf8a5eaaf3c58157251db781841d6.tar.bz2 nng-301de3ac5c7cf8a5eaaf3c58157251db781841d6.zip | |
fixes #486 Revisit SOVERSION and VERSION
fixes #485 Honor BUILD_SHARED_LIBS
fixes #483 Don't expose private symbols in shared library
fixes #481 Export CMake target
This is a "large" commit involving changes that don't affect the
code directly, but which have an impact on how we package and build
our project.
The most significant of these changes is that we now build only
either a shared or a static library, depending on the setting of
the BUILD_SHARED_LIBS option. We also suppress private symbols
from being exposed when the underlying toolchain lets us do so.
Minor updates to the way we version the ABI are used, and we now
have a nice exported CMake project.
To import this project in another, simply do find_package(nng)
and you can add target_link_libraries(nng::nng) to your targets.
CMake does the rest for you.
Diffstat (limited to 'demo/raw/README.adoc')
| -rw-r--r-- | demo/raw/README.adoc | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/demo/raw/README.adoc b/demo/raw/README.adoc index 35290616..2190dc49 100644 --- a/demo/raw/README.adoc +++ b/demo/raw/README.adoc @@ -1,14 +1,15 @@ -= async += raw This is a simple asynchronous demo, that demonstrates use of the RAW -option with a server, along with async message handling, to obtain a +sockets with a server, along with async message handling, to obtain a very high level of asynchronous operation, suitable for use in a highly concurrent server application. == Compiling -You can override the level of concurrency with the `PARALLEL` -define. This determines how many requests the server will accept +You can override the level of concurrency with the `PARALLEL` option. + +This determines how many requests the server will accept at a time, and keep outstanding. Note that for our toy implementation, we create this many "logical" flows of execution (these are _NOT_ threads), where a request is followed by a reply. @@ -16,14 +17,24 @@ implementation, we create this many "logical" flows of execution The value of `PARALLEL` must be at least one, and may be as large as your memory will permit. (The default value is 32.) -On UNIX-style systems: +The best way to build is using cmake and Ninja build: + +[source, bash] +---- +% mkdir build +% cd build +% cmake -G Ninja .. +% ninja +---- + +You can also build the hard way. For example, on UNIX-style systems: [source, bash] ---- % export CPPFLAGS="-D PARALLEL=32 -I /usr/local/include" % export LDFLAGS="-L /usr/local/lib -lnng" % export CC="cc" -% ${CC} ${CPPFLAGS} async.c -o async ${LDFLAGS} +% ${CC} ${CPPFLAGS} raw.c -o raw ${LDFLAGS} ---- == Running @@ -42,12 +53,12 @@ In the following example, all of the clients should complete within ---- % export URL="tcp://127.0.0.1:55995" # start the server -% ./async $URL -s & +% ./raw $URL -s & # start a bunch of clients # Note that these all run concurrently! -% ./async $URL 2 & -% ./async $URL 2 & -% ./async $URL 2 & -% ./async $URL 2 & -% ./async $URL 2 & +% ./raw $URL 2 & +% ./raw $URL 2 & +% ./raw $URL 2 & +% ./raw $URL 2 & +% ./raw $URL 2 & ---- |
