| | |
basis server creation fail using pipes ???
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: May 2009
Posts: 8
Reputation:
Solved Threads: 0
Hi,
I am new to c++ programming.... i am working on a example and when ever i run the following code i get error "Server fifo failure" this is an example and should work alright but error making no sense...
I am running this code using sun C++ compiler....
Plzzzz help....
[code]
Reply With Quote
I am new to c++ programming.... i am working on a example and when ever i run the following code i get error "Server fifo failure" this is an example and should work alright but error making no sense...

I am running this code using sun C++ compiler....
Plzzzz help....
[code]
c++ Syntax (Toggle Plain Text)
#include "common.h" #include <ctype.h> int main() { int server_fifo_fd, client_fifo_fd; struct data_to_pass_st my_data; int read_res; char client_fifo[256]; char *tmp_char_ptr; mkfifo(SERVER_FIFO_NAME, 0777); server_fifo_fd = open(SERVER_FIFO_NAME, O_RDONLY); if (server_fifo_fd == -1) { fprintf(stderr, "Server fifo failure\n"); exit(EXIT_FAILURE); } sleep(10); /* lets clients queue for demo purposes */ do { read_res = read(server_fifo_fd, &my_data, sizeof(my_data)); if (read_res > 0) { tmp_char_ptr = my_data.some_data; while (*tmp_char_ptr) { *tmp_char_ptr = toupper(*tmp_char_ptr); tmp_char_ptr++; } sprintf(client_fifo, CLIENT_FIFO_NAME, my_data.client_pid); client_fifo_fd = open(client_fifo, O_WRONLY); if (client_fifo_fd != -1) { write(client_fifo_fd, &my_data, sizeof(my_data)); close(client_fifo_fd); } } } while (read_res > 0); close(server_fifo_fd); unlink(SERVER_FIFO_NAME); exit(EXIT_SUCCESS); }
![]() |
Similar Threads
- Mail keeps going offline (OS X)
- SQL 2000 ODBC and SP4 problem (MS SQL)
- Domain Issues...... (Windows Servers and IIS)
- Newbie Help: Setting up a simple intranet (Networking Hardware Configuration)
- firewall problem. please help (Network Security)
- network segmentation (Network Security)
- IRC Chat (C)
Other Threads in the C++ Forum
- Previous Thread: c++ problem with program
- Next Thread: destructor question
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





