i am writing a small C program in linux that is using the qt library for GUI development but it seems that my socket call is hanging the GUI and not letting it update.
It updates does only after it gets all the 20 IP(s) in list though all this is done in a seperate thread
socket calls //using iotctl(FIONBIO) calls here
retrieve the IPs
fille the GUI list
it's not blocking as it is recursing and returning -1 from recv for those sockets which has no data.
but it's not letting hold the list view to update, only when the 20 loops are recursed the list view is update.
all this is done in a seperate thread . any pointers as to how can i do a synchronous I/O so that my thread could be called only when there is a recv to be done .
anypointer please .
struct sockaddr_in from;
struct ip* ipheader;
struct tcphdr *tcpheader;
char * buf;
sock = socket(AF_INET,SOCK_RAW,IPPROTO_TCP );
bytes_rec = recv(sock,buffer,sizeof(buffer),0);
tcpheader = ( struct tcphdr *)(buffer + (ipheader->ip_hl));
QListViewItem * item = new QListViewItem(tview,label1);