NEWS: Total Picture Views: 155282 | Total Article Views: 165606 | Top 5 Most Popular Article: 1. Am I Stuck Algorithm with Becker Robot | 2. PickUpThings with Becker Robot | 3. How to read a JSON and work with it | 4. Encrypted Data GUI (Download .Zip) | 5. Create Wall and Things with Becker

Communicating with Server and Client [Client Code] C

Description:

In this example I will be showing the client code that we will call to send a message to the server via argument.

Code:

#include <stdio.h>
#include <stdlib.h>
#define FIFO_FILE "MYFIFO"

int main(int argc, char *argv[])

{

	FILE *fp;

	if (argc != 2) {

		printf("USAGE: fifoclient [string]\n");

		exit(1);

	}

	if ((fp = fopen(FIFO_FILE, "w")) == NULL) {

		perror("fopen");

		exit(1);

	}

	fputs(argv[1], fp);

	fclose(fp);

	return(0);

}
Attachments: None

Tags: Node Client Argument Linux

Total Views: 838

My name is Jean-Mathieu

I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.

jean8mathieuCreated on 03/30/15


affiliate_link

Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.