Skip to content
Advertisement

Tag: c++

How to interact between webpage and an actual program

What I have: A program (c++) on a server (linux) The program can be executed with command line parameters The program finishes after a while and produces continously output (“log.txt”) What I want: My idea is to have some kind of user interaction with that program: The user opens a website which shows some inputs (checkboxes, etc.) After submitting (POST)

C: finding longest line

I am trying to run this example from (dennis ritchie book), however it does not find the longest line, any idea? main.c other.c other.h Using debugger: looks like i in copyL function does not increment… any ideas why? FIX: Answer I think you incorrectly transcribed the code. This line: is probably incorrect. The expression (to[i], from[i]) is an instance of

Can socket send fail cause a daemon program crash?

I have two applications running on Embedded Linux board. One runs as a daemon and other acts as an interface for it. They communicate with each other using Unix sockets. As to handle any abnormal termination of socket, I tried terminating the interface application [ctr+c]. But as a result, the daemon application crashes. Since the socket is terminated, I get

What is the integer value of AF_UNIX?

So, I’m trying to write some JNA code to work with Unix sockets, and I’m trying to reference AF_UNIX for sockets. I looked through some of the gcc included files, but I couldn’t find anything. Answer On my Ubuntu-machine it is defined in /usr/include/x86_64-linux-gnu/bits/socket.h as 1. I haven’t checked around in other Unix source trees, but I have a feeling

Linux-C: reading from pipe returns first buffer written to it

This program simulates a variant of Dijkstra’s Producer/Consumer problem. A pipeline is first created followed by a child process using fork(). The child will then write to the pipe a crudely done randomly generated piece of “stock market ticker information”. After waiting for the child/producer process to write this information, the parent/consumer process will read it out. The first output

Advertisement