Skip to content

Instantly share code, notes, and snippets.

View dmitru's full-sized avatar
🎯

Dmitry Borody dmitru

🎯
  • Inkarnate
  • Remote
  • 08:06 (UTC +04:00)
View GitHub Profile
@dmitru
dmitru / client.c
Created May 16, 2013 20:05
A UNIX socket client
// Usage:
// client <address> <port>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <sys/types.h>
@dmitru
dmitru / server.c
Created May 16, 2013 19:37
A simple UNIX socket server
// You can test your server programs with 'telnet' UNIX tool.
// see man telnet!
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
struct thr_data{
double b;
double e;
double step;
double count;
};
@dmitru
dmitru / reader.c
Created October 5, 2012 22:31
One-way communication with FIFOs
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define BUF_SIZE 4096
@dmitru
dmitru / 000.c
Created September 13, 2011 15:22
MIPT EJudge problems
/*
MIPT, task #000
"A + B"
12.09.2011
*/
#include <stdio.h>
int main ()
{