Code Monkey home page Code Monkey logo

c-core's Introduction

Pubnub C/C++ client libraries

Build Status

This repository has the source for the C/C++ client libraries, designed mostly for embedded systems, but perfectly suitable for "regular" (POSIX, Windows) systems, too.

Official Docs

Docs for C/C++ for Posix, Windows, as well as FreeRTOS and other embedded platforms are available at https://www.pubnub.com/docs/posix-c/pubnub-c-sdk

Please direct all Support Questions and Concerns to [email protected]

Build

Our repository can be build via two different approaches:

CMake (new but recommended)

You can build repository using CMake using our CMakeLists.txt file.

  • Unix:
mkdir build && cd build
cmake ..
make
  • Windows (MSVS tools required):
mkdir build && cd build
cmake .. -G "NMake Makefiles"
nmake 
  • for other platforms you can search for information in FreeRTOS or QT READMEs.

There are several options to be selected via switches (using GUI) or by using command line.

cmake .. -DOPENSSL=ON -DEXAMPLES=ON <etc...>

Check the CMakeLists file for more info.

Makefiles (legacy)

You can build our SDK using standard tooling depending on OS you're using. For more info check those links:

depending on what fits you best.

Directory Organization

The directories of the library repository are:

  • core : The core part, with modules portable to all, or most, libraries for specific platforms

  • lib : Modules for libraries that are available on more than one platform

  • windows : Modules and Makefile for the Windows platform

  • posix : Modules and Makefile for POSIX OSes (tested mostly on Linux)

  • openssl: Modules and Makefile(s) for OpenSSL (on POSIX and Windows)

  • mbedtls: Modules for MBedTLS

  • cpp: Modules, Makefile(s) and examples for the C++ wrapper

  • qt: Modules, Qt projects and examples for Qt

  • freertos : Modules and Makefile for the FreeRTOS and ESP32 platforms

  • microchip_harmony : Modules and project for Microchip MPLAB Harmony

  • unreal : Unreal Engine integration module

Files

In this root directory we have some files, too:

  • posix.mk: a "master" Makefile for POSIX - will build all the POSIX Makefiles there are (doesn't build Qt - you might not have Qt)
  • windows.mk: a "master" Makefile for Windows - will build all the Windows Makefiles there are (doesn't build Qt, you might not have Qt). For UWP support, use uwp.mk Makefile.
  • .pubnub.yml: Standard Pubnub library description in YAML
  • .travis.yml: Configuration for Travis CI (POSIX: Linux and MacOS)
  • .appveyor.yml: Configuration for Appveyor CI (Windows)
  • .clang-format: Configuration for Clang-format tool that we use to format C/C++ source code

Contributing

Please read the Contribution Guidelines.

c-core's People

Contributors

650elx avatar anovikov1984 avatar budgetpreneur avatar chriskush avatar client-engineering-bot avatar crimsonred avatar macgritsch avatar marcgeh avatar maxpresman avatar parfeon avatar rmadair avatar samiahmedsiddiqui avatar seba-aln avatar sjaeckel avatar sveljko avatar vveljko avatar walterbrebels avatar xavrax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

c-core's Issues

Context's limit

Hey, I wonder, how many contexts can I create in a single program? I am using C++ pubnub::context API?

Block on subscribe

Hey, I am using 3.1.0 library version. From time to time when I am using multiple context's one of them is getting blocked in subscribe on wait on conditional variable in futres_cpp11.
image
And it's not getting out of it ever.
Any hints what could be a reason?
My usage is like:
Create context -> Subscribe on channel with "then" callback -> On callback dispatch back to context thread -> get_all() -> handle messages -> resubscribe.
And its getting stucked on resubscribing, however it does not happen every time.

'Select' limitation

Hey !
I am encountering an issue in which once my application reach 1024 open FD, and i am trying to open pubnub connection i am getting crash due to select in 'pbpal_resolv_and_connect_socket'.
Do you have any plans for implementing epoll support?

`make -f posix.mk clean` target appears broken

 $ make -f posix.mk clean
make -C posix -f posix.mk clean
make[1]: Entering directory '/home/anzu/Projects/c-core/posix'
rm pubnub_advanced_history_sample pubnub_sync_sample pubnub_sync_subloop_sample cancel_subscribe_sync_sample pubnub_sync_publish_retry pubnub_publish_via_post_sample pubnub_callback_sample pubnub_callback_subloop_sample subscribe_publish_callback_sample pubnub_fntest pubnub_console_sync pubnub_console_callback pubnub_sync.a pubnub_callback.a subscribe_publish_from_callback publish_callback_subloop_sample publish_queue_callback_subloop *.o *.dSYM
rm: cannot remove '*.dSYM': No such file or directory
posix.mk:190: recipe for target 'clean' failed
make[1]: *** [clean] Error 1
make[1]: Leaving directory '/home/anzu/Projects/c-core/posix'
posix.mk:13: recipe for target 'clean' failed
make: *** [clean] Error 2

Fix is to put a hyphen before rm

Would you accept a PR resolving the issue this way?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.