Monday, February 20, 2012

Unix Tools - Socket Clien/Server [Simsimi]

Running
.Actually you have to use Unix machine to run these program .
.I recommand to you a Makefile for easy using :
     vi Makefile:
.To compile program just $make
.To run server just $make runs ( do this first )
.To run client just $make runc ( do this after run server in other windows )
.To clean executed program just $make clean
.See this example for this program :
client process simsimi



client.c
/* C library need to include */
#include <string.h>  #include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <sys/un.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdbool.h>

#define MYBUFERSIZE 256


 
server.c
/* C library need to include */
#include <string.h>  
#include <sys/types.h>
#include <sys/socket.h> 
#include <stdio.h> 
#include <sys/un.h> 
#include <unistd.h> 
#include <stdlib.h>
#include <stdbool.h>

#define MYBUFERSIZE 256



No comments:

Post a Comment