[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: network question




> 
> Hello, I had a question.
> 
> I'm programming a network application, which uses gtk_input_add to assing
> a function to the `read'ability of a INET stream.
> The problem comes here: How do I detect if the other side has closed the
> connection? I can't just read(),and check for it to return 0, because
> read() will wait for data. And my function isn't called if there isn't any
> data to read (which is logical, the connection was closed)
> 
> How do I solve this problem ???
> 
> Gert
> 

I think you're wrong, read() won't wait for any data since
EOF was reached. Actually I'm already using that in a GTK
telnet client :) At least try it, even if I'm mistaken.

Xann.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]