WebSocket client in C and win32 for Windows 7 - c

I'm trying to figure out a way to implement a sample WebSocketClient in C using win32 APIs. I need it to communicate with a HTML+JS WebSocket server.
I see that most of the WebSocket specific APIs are supported only Windows 8 and above.
Like in WinHttpWebSocketCompleteUpgrade function
Is my understanding incorrect?
Any guidance, if the approach is feasible, would be of much help.

There is another Windows API for WebSockets called WebSocket Protocol Component API. Microsoft has also provided a sample code on Github which is a good starting point.

Related

Azure Kinect: how to find the windows device id

I have been developing a Win application that uses 3 Azure Kinects. Since there is no C# wrapper available yet, I made a C++ app that does what I need and the C# app just grabs its output files.
I now need to figure out which camera is which. In the C# app I can get the windows device id in a form similar to
\\.\USB#VID_045E&PID_097C#001007692912#{A5DCBF10-6530-11D2-901F-00C04FB951ED}
However the C API for the Kinect only provides ways to get the serial number of the device.
I tried to dig into the API, since I'm sure it must be somewhere in the code but, due to my limited C skills, I got lost pretty quickly.
Anybody with the same issue or can help?
Thanks,
Guido
The SDK is designed to use serial number specifically to determine which device or devices you are connected to. If you are just trying to use 2 Kinects with 2 instances of your C# then you will need to open devices until you find the serial number you are looking for. If you are trying to use multiple devices in a master/subordinate configuration then you can query for jack state to determine if you have connected to one or the other.
Also please be aware that we just released our own C# wrapper for the SDK. Checkout https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/608 and https://microsoft.github.io/Azure-Kinect-Sensor-SDK/master/namespace_microsoft_1_1_azure_1_1_kinect_1_1_sensor.html for more details.

Information for connecting SIP user Agent with SIP server(Opensip)

I am a newbie to sip server and i am experimenting with it using c programming.
I have installed open sip server on my ubuntu 13.04.
and i am trying to configure it.
can somebody provide me a basic example showing how a user agent registers to sip server.
Do i have to download some specific sip user agent.
if yes,can you suggest me some names
so that i can start programming in right direction.
Well, you can use XLite of course. That's free and simple enough.
http://www.counterpath.com/x-lite-download.html
For SIP and OpenSIPs you should refer to the official documentation which also have a number of nice webinars.
http://www.opensips.org/Documentation/Webinars
I advise you to start with SIP introduction and Introduction to OpenSIPS

Send data from local webpage to C program running locally

I'm looking for the simplest possible (cross-platform, but not necessarily cross-browser) code to send data from a local web page to a C (not C++) application running locally. Basically, I have an HTML page with a form and I want to send the data from that form to another process in the simplest way possible. (I know that I can read local data from a webpage relatively easily, especially now with HTML5, but writing outside of the javascript sandbox is a mystery.)
I know that browsers make this very hard to do for security concerns, and I don't want to open up my machine to attacks, but maybe I can run a very simple server inside the C application to receive the submitted data... Either way, I cannot run any standard webserver, so I need to have a C library/app that does it for me.
I've looked into .hta files (seem to only work for Windows) and some C web servers (all I've found are *nix specific). A similar question is how to transfer of data from webpage to a server c program , except that user allows the use of Java and other webserver platforms (I must use C).
UPDATE: Promising libraries: https://stackoverflow.com/questions/175507/c-c-web-server-library
Have you considered FastCGI? I have a fast CGI library written in C that might be helpful. It still needs a lot of work and I'm not sure if I would want to use in a production environment.
If you find any bugs or make any enhancements, please share them so that it can help others.
https://github.com/manvscode/shrewd-cgi
You could write a very simple web server in C, serve the page from it (avoids security issues), and post the form to it.
If you're bound to c, you'll have to go low-level and deal with all the nifty details around the sockets library. (There's a reason why people abstract that in high-level languages). Check out some example code for RPC in C with server and client here. If you can afford to bind to C, e.g. using Tcl, i would implement the server in a tcl script and bind your C functions as a Tcl command. That way you pass the content directly to your c method while avoiding to write all the sockets code low-level.
Send the desired data from web to specific port of your system (for example port X). Then run your application (e.g. APP) in background using following command:
nc -l X | ./APP
And of course you need nc package.

Bluetooth connection with Nokia e63 in java?

I want to connect with my nokia e63 mobile using bluetooth or usb with pc but that using java application.
I want to know about how to do that ? And
my question are like :
Can I connect with using java application and if yes then how ?
I mainly want to get the calling information. I want to save the calling information like whose called on which time in database but for that i need the number whose calling ? Is this possible with using java application ?
And any references will very much helpful.
Thank You...
I developed an Bluetooth Java Applicaton 1 year ago and I 've used the Java Docs pretty much which are really helpful !
http://developers.sun.com/mobility/midp/articles/bluetooth2/ , http://developers.sun.com/mobility/apis/articles/bluetoothcore/
I don't know how to access call informations but connecting is not that difficult.

using libcurl to create a standalone site-polling program

I am creating a standalone (no DLLs) windows C/C++ program that uses HTTP POST to periodically send data to an HTTP server. I identified libCURL as the HTTP client library as it seems simple and reliable.
I still need to identify the environment (an IDE) which I can use to develop my project. My program has:
poller- which checks the status of the connection
a file writer when polled link is down
a component which POSTs the file when link is up
What is the appropriate IDE for this project? I heard endorsements for DevC++ and Visual C.
I am a newb to coding and this site. Pardon me if I am unclear in anything.
Any IDE will fit your need. Just install one of them and start coding.
Try CodeBlocks. It is light, more easy to work with and has more features than Dev C++.

Resources