I've got a problem related to write to files.
I've created server/client
in c
(for Linux
, via sockets
).
I want the clients
to save a log file with all the actions they did. When I open a client and transfer file everything is OK but when I check my server's multi requests support (by creating a bash script that checks it all) I discovered that none of my clients write anything.
Client command is: ./client_prog host port file_to_receive log_file
Script:
cd client1/
./client_prog localhost 22222 file.txt log &
cd client2/
./client_prog localhost 22222 file.txt log &
cd client3/
./client_prog localhost 22222 file.txt log &
#more clients....
each client create log thread and with pipe transferring data, and the log thread write it with fopen
(), fprintf
() and fclose
().
BTW, when I try from two different terminals, it's working fine.
It doesn't make any sense..
Thanks!