Please tell me why the follwing program is not working........ ....
client.c
#include<stdio. h>
#include<sys/socket.h>
#include<sys/un.h>
int main()
{
int sd, cd, len, re;
char data[100];
struct sockaddr_un local, remote;
sd = socket(AF_UNIX, SOCK_STREAM, 0);
local.sun_famil y = AF_UNIX;
strcpy(local.su n_path, "sock");
len = sizeof(local.su n_family) + strlen(local.su n_path);
re = connect(sd, (struct sockaddr *)&local, len);
scanf("%s",data );
send(cd, data, strlen(data)+1, 0);
}
server.c
#include<stdio. h>
#include<sys/socket.h>
#include<sys/un.h>
int main()
{
int sd, cd, len, re;
char data[100];
struct sockaddr_un local, remote;
sd = socket(AF_UNIX, SOCK_STREAM, 0);
local.sun_famil y = AF_UNIX;
strcpy(local.su n_path, "sock");
unlink(local.su n_path);
len = sizeof(local.su n_family) + strlen(local.su n_path);
re = bind(sd, (struct sockaddr *)&local, len);
listen(sd, 5);
cd = accept(sd, (struct sockaddr*)&remo te, &len);
printf("%s",dat a);
recv(cd, data, 100, 0);
printf("%s\n",d ata);
}