I'm working a program to implement a simple multi-process browser. The browser works by having a ROUTER process as the parent of everything else in the program. There's another process called the CONTROLLER which is part of where the user can input information. To tell the ROUTER to make a new tab in the browser the user activates a function from the CONTROLLER to send the create new tab information to the ROUTER:
Code:
void new_tab_created_cb(GtkButton *button, gpointer data)
{
if(!data)
return;
int tab_index = ((browser_window*)data)->tab_index;
comm_channel channel = ((browser_window*)data)->channel;
// Create a new request of type CREATE_TAB
child_req_to_parent new_req;
new_req.type = CREATE_TAB;
new_req.req.new_tab_req.tab_index = tab_index;
if (write(channel.child_to_parent_fd[1],(char*)&new_req,sizeof(child_req_to_parent)) == -1);
{
perror("Error:Couldn't write new_tab_created to Router from Controller!");
}
}
When run the error at the end of this code is hit with:
Code:
Error:Couldn't write new_tab_created to Router from Controller!: Resource temporarily unavailable
What's the resource unavailable error coming from and how can it be fix? Thanks!