make your read/write operations O_NONBLOCK either while opening the fd or just before reading. you can do it by adding O_NONBLOCK to "open" or if the fds are already open you can use "fcnt( fd, lF_SETFL, O_NONBLOCK)" . To make your operations non-blocking. Just before you start reading the device,use "select" to see if the data is realy present or not !
-Vinayak On Tue, 8 Mar 2005 23:39:09 -0800, Sagar Gokhale <[EMAIL PROTECTED]> wrote: > > > > > > But recv () is not coming back from call. > > > What should I do so that as soon as I close socket > > > recv () will give error or come back from blocking > > > state. > how about using select() to block instead of recv? i think that should > solve all problems. comments? > > ~sagar > > -- > Sagar Gokhale > -- > ______________________________________________________________________ > Pune GNU/Linux Users Group Mailing List: (plug-mail@plug.org.in) > List Information: http://plug.org.in/mailing-list/listinfo/plug-mail > Send 'help' to [EMAIL PROTECTED] for mailing instructions. > -- ______________________________________________________________________ Pune GNU/Linux Users Group Mailing List: (plug-mail@plug.org.in) List Information: http://plug.org.in/mailing-list/listinfo/plug-mail Send 'help' to [EMAIL PROTECTED] for mailing instructions.