using libcurl to create a standalone site-polling program - c

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++.

Related

What is the difference between endpoints-framework:clientLibs and endpoints-framework:generateSrc?

I've just tested both of them and got the same results. Why?
My intent is to generate server stubs for Google Java Endpoints Framework from OpenAPI specification. Is it possible?
First, I must say I do not believe that our intention is not facilitate the creation of new projects using these tools. These tools were built for migrating old projects and are not a recommended path forward.
But to answer your question:
endpoints-framework:clientLibs is an operation your run on your server side project (appengine). It just downloads a client library (zip) for you. You can process and use this downloaded library in another project to consume the endpoint.
endpoints-framework:generateSrc is an operation you run on the endpoints consumer (or client). This is a helper that automatically includes the client library code in your project (it also downloads the client library), so you don't have to copy that code in yourself (or generate a library an import it in)

"stack.cpp not found" prevents debug in VS 2013 express

I'm a rookie at C in general and VS 2013 also. I am trying to use some C code provided by a vendor in VS 2013 express. It compiles and runs without problem using the command line compiler but I would like to use the IDE.
I started a new project, C++ for console app, and I have pasted the code into the IDE and saved it as xyy.c so that it builds successfully. I thought it would be nice to have it in a GUI, so I duplicated the effort with a Win32 app project. It also builds.
The program's job is to connect to a PCI card that has Plx chip as an interface and program an FPGA. The Win32 program succeeds, even though I can't see any of the info printed by the program. The console program fails and I think it is because it fails to find the driver for the Plx chip. I thought I would get a clue by single stepping through the Win32 program to see which driver was supposed to be found.
However, after the first pass through a while loop, I get a pop up that says "Source Not Found" and "stack.cpp not found". Google wasn't any help to me.
I be grateful for any suggestions.
You might have "Enable .NET Framework source stepping" enabled (see http://msdn.microsoft.com/en-us/library/cc667410.aspx). So when you are at Stack... and trying to step into, it will actually try, but you don't have the sources for that. There is also a new experience for using the .NET framework reference source that was announced recently: http://blogs.msdn.com/b/dotnet/archive/2014/02/24/a-new-look-for-net-reference-source.aspx
I faced the same problem. I advise at the moment of receiving the information "stack.cpp not found" to look at the stack trace and check if there is something like this: "RTC".
If there is, you need to change the flag along the path (for example, set the Default or a more convenient configuration for you):
Project Properties -> C/C++ -> Code Generation -> Basic Runtime Checks
More details: https://learn.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160

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.

Creating a server socket in beaglebone

I'm new in using beaglebone, and I need some help about some issues I'm facing.
I wrote a code in c (running in a laptop with ubuntu) in which a server socket is opened (running an apache server), and then another device connects to it through internet.
I would like to do the same in the beaglebone with ansgtrom distro (the one that comes with the board). I have read that angstrom distro comes with cloud9 (which from what I understand it acts as a server, like apache).
So, how can I create/open/use a server socket (through a program written in c) in cloud9-beaglebone?
Also, how can I configure cloud9 to store certain webpage? Is such configuration similar to the one in apache?
Cloud9 IDE is an IDE for developing code for Node.JS.
The version of Node.JS used today is 0.6.20. There are examples on the nodejs.org home page and for the particular version at http://nodejs.org/docs/v0.6.20/.
To serve up web pages, I recommend you look into frameworks like ExpressJS. You can use the 'npm' utility under the Cloud9 IDE or the command line to install ExpressJS.
Since Cloud9 IDE allows you to edit C code, you can create typical C code that opens and serves sockets. pkg-config is installed to help you with linking libraries. You'll want to go to https://beaglebone.local to use Gate One to ssh into the board (username: root, password: ) and run the C compiler from the command line. You can use the same tools you'd use under Ubuntu, like 'make' and 'g++'.

HINTERNET InternetOpenUrl() on linux C

I am a native windows programmer and I was just starting to develop some applications on linux. I was wondering if there is a linux function similar to InternetOpenUrl(). I wanted to use this so I could open the Speakeasy speed test to download random images according to size to "speed test" internet connections. If there isn't a similar command does anyone have some C code for initiating a http socket to a server to download a file (or code to do the same on a ftp although i rather not use ftp). I would rather use the InternetOpenUrl() alternative if there is one but i am also open to other methods as well.
You're looking for libcurl, which incidentally also works on Windows.

Resources