mellowswng
December 31st, 2007, 09:39 PM
Hello ,
I am developing a network application (in C ) as a project for school and appear to have some problems with programming the UI for the client with GTK , i have just begun learning GTK ... anyway the problem is that I can't find a way to constantly read from my socket connected to the server without freezing the application window.... clicking some buttons in my app. sends direct commands to the server and waits for reply to then act correspondingly ... but some events aren't that synchronized and so the client has to read all the time what's new from the server ... this would have to be something to be done in the background .... The only idea i came up with was to separate the interface from the actual client in another C program ( child for the interface program ) and to redirect the output of it to the interface program ... also when i need to send something to the server i call a signal for the child to read what's in a pipe / fifo .... but that seems like a long way around for something that I think must be done much more easy ...
Thanks in advance.
I am developing a network application (in C ) as a project for school and appear to have some problems with programming the UI for the client with GTK , i have just begun learning GTK ... anyway the problem is that I can't find a way to constantly read from my socket connected to the server without freezing the application window.... clicking some buttons in my app. sends direct commands to the server and waits for reply to then act correspondingly ... but some events aren't that synchronized and so the client has to read all the time what's new from the server ... this would have to be something to be done in the background .... The only idea i came up with was to separate the interface from the actual client in another C program ( child for the interface program ) and to redirect the output of it to the interface program ... also when i need to send something to the server i call a signal for the child to read what's in a pipe / fifo .... but that seems like a long way around for something that I think must be done much more easy ...
Thanks in advance.