Coder Social home page Coder Social logo

socketcluster-client-c's Introduction

C Socketcluster Client

Overview

This client is developed using libwebsockets and json-c library in C.

Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources, and provide fast throughput.It is a CMake based project that has been used in a variety of OS contexts including Linux (uclibc and glibc), ARM-based embedded boards, MBED3, MIPS / OpenWRT, Windows, Android, Apple iOS and even Tivo. It's used all over the place including The New York Times customer-facing servers and BMW. Architectural features like nonblockinng event loop, zero-copy for payload data and FSM-based protocol parsers make it ideal for realtime operation on resource-constrained devices.

Json-c is one of the most performant and easy-to-use JSON implementations in c. To use json-c objects in client follow tutorials on json-c.

More contributions are always welcome :)

More documentation coming soon..

socketcluster-client-c's People

Contributors

sacoo7 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

socketcluster-client-c's Issues

Why should websocket be destroyed when getting LWS_CALLBACK_CLIENT_WRITEABLE?

When socket become writeable, runtime error rises because web client go to be destroyed..

The related code is in scclient.cpp,
if (writeable_flag)
destroy_flag = 1; <= raise problem
}
break;
case LWS_CALLBACK_CLIENT_WRITEABLE :{
// printf(KYEL"[Main Service] On writeable is called. send byebye message\n"RESET_);
websocket_write_back(wsi, (char *)"Byebye! See you later", -1);
writeable_flag = 1;

Not able to establish SSL connection

Hello,
I am able to connect a server with ws protocol but not with wss.
i have ca_cer file.
Can you provide a sample or proper documentation on how can i make SSL connection.

Thankyou

[Request] Can you provide more detail document?

I tried to build the source in xcode but got no success.
There are many things to do be done before I can build the project, like to install libwebsockets and json-c, openssl.

Can you provide us a document with step to step guide how to run this project?
Thank you.

Bus error issue about socketcluster-client-C

I use socketcluster-client-C, after compiled the emitter.c and run it, but i got
some errors as follows:

kimatoMacBook-Pro-3% ./emitter
[2017/05/03 15:18:18:3930] NOTICE: Initial logging level 7
[2017/05/03 15:18:18:3931] NOTICE: Libwebsockets version: 2.2.0 [email protected]
[2017/05/03 15:18:18:3931] NOTICE: IPV6 not compiled in
[2017/05/03 15:18:18:3931] NOTICE: libev support not compiled in
[2017/05/03 15:18:18:3931] NOTICE: libuv support not compiled in
[2017/05/03 15:18:18:3931] NOTICE: Threads: 1 each 256 fds
[2017/05/03 15:18:18:3931] NOTICE: mem: platform fd map: 2048 bytes
[2017/05/03 15:18:18:3932] NOTICE: Compiled with OpenSSL support
[2017/05/03 15:18:18:3932] NOTICE: SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
[2017/05/03 15:18:18:3932] NOTICE: Creating Vhost 'default' port -1, 2 protocols, IPv6 off
[2017/05/03 15:18:18:3932] NOTICE: mem: per-conn: 568 bytes + protocol rx buf
[2017/05/03 15:18:18:3932] NOTICE: canonical_hostname = kimatoMacBook-Pro-3.local
[Main] context created.
zsh: bus error ./emitter

Can you give me some suggestions, thanks!

ERR: SSL_new failed: error

[2018/02/14 13:52:54:1746] NOTICE: Initial logging level 7
[2018/02/14 13:52:54:1747] NOTICE: Libwebsockets version: 2.0.3 unknown-build-hash
[2018/02/14 13:52:54:1748] NOTICE: IPV6 not compiled in
[2018/02/14 13:52:54:1749] NOTICE: libev support compiled in but disabled
[2018/02/14 13:52:54:1749] NOTICE: libuv support compiled in but disabled
[2018/02/14 13:52:54:1757] NOTICE: Threads: 1 each 1024 fds
[2018/02/14 13:52:54:1758] NOTICE: mem: platform fd map: 4096 bytes
[2018/02/14 13:52:54:1760] NOTICE: Compiled with OpenSSL support
[2018/02/14 13:52:54:1761] NOTICE: SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
[2018/02/14 13:52:54:1762] NOTICE: Creating Vhost 'default' port -1, 1 protocols
[2018/02/14 13:52:54:1763] NOTICE: mem: per-conn: 600 bytes + protocol rx buf
[2018/02/14 13:52:54:1765] NOTICE: canonical_hostname = UNIT2
[Main] context created.
[Main] wsi create success.
[2018/02/14 13:52:54:5897] NOTICE: lws_protocol_init
[2018/02/14 13:52:54:9032] ERR: SSL_new failed: error:00000001:lib(0):func(0):reason(1)
[2018/02/14 13:52:54:9034] ERR: *** 336306371 error:140BA0C3:lib(20):func(186):reason(195)
^C[2018/02/14 13:52:56:3943] NOTICE: lws_context_destroy

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.