I forgot to specify that I am using shared memory to share array of fd among 2 processes.
Now tell me if child 3 will be able to send msg to client ??
Here is the code
...
Type: Posts; User: smitpatel24
I forgot to specify that I am using shared memory to share array of fd among 2 processes.
Now tell me if child 3 will be able to send msg to client ??
Here is the code
...
what if child 3 somehow get pointer to fd returned by accept call ??
will child 3 be able to send msg to client ??
I want child 3 to be able to send msg to some clients (not all connected).
server creates child 3 according to client request.
I want to send diff client diff reply from other child process of server
For that I use fd of client.
Every forked child process of server replies to particular client (child created on that client...
calloc function returns void pointer and buffer is character pointer therefore I have put (char *) in line
char *buffer=(char *)calloc(256,1);
include<stdio.h>
#include<stdlib.h>
int main()
{
char *cmd="pwd";
char *buffer=calloc(256,1);
FILE *f=(FILE *)popen(cmd,"r");
printf("\nOutput\n");
...
FIRST CODE
#include<stdlib.h>
#include<stdio.h>
int main()
{
int n=1;
char *cmd="pwd";
char *buffer=(char *)calloc(sizeof(char),256);