socket.io library in C - websocket

I have already looked at some options such as cellophane but found that the sample app crashes. Also it does way more than just implement socket.io protocol because it uses json and curl. What I am looking for is a simple library in C (not c++, so no boost) which does the encoding and decoding of data using socket.io protocol, so that it can be used with any other library that does network i/o. The purpose is to implement a native client for linux developed in C to talk to node.js server.
Any libraries/solutions that would help is appreciated. Also any documentation on socket.io protocol would help, so that I can look at implementing it.
Thanks.

Related

Square Wire Service Implementation

I'm trying to learn about grpc and protocol buffers while creating a test app using square's wire library. I've got to the point of generating both client and server files but I got stuck in creating a server side app. The documentation is too simple and the examples in the library have to much going on.
Can anyone point out what are the next steps after generating the files?
Thanks.
I'm not sure what language your are using, but each gRPC language has similar set of examples. For example, for a simple server-side app, you can find the Python example at https://github.com/grpc/grpc/blob/master/examples/python/helloworld/greeter_server.py

How to implement SignalR using websockets

I am trying mostly for learning purposes to implement a module similar to SignalR(still a beginner in SignalR) using raw websockets. (I am already very familiar with websockets)
Is there any guide or something that explains what functionality does SignalR have on top of websockets? (so that i know what features i need to implement) ? .
From what i understood it keeps a persistent connection , and can fallback to other protocols if websockets are not supported (long polling ...etc).
I have already checked this video but i need something more in detail.
I had written one article regarding SignalR one year back. It contains SignalR basic information and code example.
Following is the link of it -
https://medium.com/#aparnagadgil/real-time-web-functionality-using-signalr-ba483efcb959
Hope this helps you!

Stream Audio with Socket.io using Golang

I have developed a golang application (multiplayer game backend) using socket.io.
I am using socket.io plugin made in golang.
Now i want to stream audio between peers.
So do you know any approach for achieving this?
I know socket.io stream library, but how can i use that in/with golang???
kindly help
Socket.io is useful because it is flexible and higher level, but since you want to stream audio data, you might be interested in WebSockets. Socket.io is capable of using the WebSocket transport, but in your case pure WebSockets might be a better solution.
This Medium Post talks about why you might not need Socket.io.
This other Medium Post talks about how to implement audio streaming using WebSockets.
This tutorial and this other tutorial might help you getting started in WebSockets in go.

Protocol Buffers - RPC

I'm trying to have a messaging service(over TCPIP) between windows on PC(running C# app) and linux on an SoC board(running C++ app). I went through Google's protocol buffers and thought that I can serialize the structure (data struct) into a buffer and write this buffer over sockets(saw an example too).
My question, is there another way to do this? What does protocol buffer-RPC do? I went through their documentation but they don't specify on how to do it with TCPIP. Maybe someone has examples for this or detailed documentation?
Thank you,
Karthik.
My question, is there another way to do this?
There are many ways to do this. Google Protocol Buffers is library for cross-platform object serialization. You can share this serialized data in many different ways. My recommendation for you is using ZMQ (ZMQ GUIDE) which is perfectly suited for applications like yours.
I have a similar use case to you. I wrote Linux C++ ZMQ server on Raspberry Pi and Python ZMQ client dedicated for telemetry and remote management purposes. This library is efficient, lightweight, works perfectly with Google Protocol Buffers and has binding to all major programming languages. If you decide to use this library do not hesitate to ask me about working code example.
See if the Google Developers page on how the protocol buffers wire format is encoded helps with your question: https://developers.google.com/protocol-buffers/docs/encoding

Is there a socket.io port to Dart?

I've taken a look at the basic websocket capabilities in Dart, using this simple example:
https://github.com/financeCoding/chat-websocket-dart
But I was wondering if there's a nice library I could use to build a realtime online game using websockets. I've had experience in this using node.js with socket.io, which worked out quite well. I need to be able to have "rooms", join rooms, leave rooms, broadcast to clients in a room, etc. as well as some nice notion of connection "health", reconnection etc. So what I'm asking is if there's a nice library for dart that has similar functionality? Even cooler would be a library on top of that library that could enable nice RPC functionality with variable syncing etc. such as http://nowjs.com/ which achieves this using socket.io. But I guess that might be too ambitious.
If anyone's had any experience or found a project which is similar to what I'm talking about, let me know :)
Duct is clone of Socket.IO in Dart which aims to be protocol-level compatible with the original implementation.
https://github.com/petrhosek/duct
Sorry, at the time of this writing, I'm not aware of a socket.io port for Dart. socket.io is nice because it has a bunch of implementation options for browsers that don't support Web sockets.
Sounds like a good idea for a hackathon project!

Resources