Quote Originally Posted by bhs-ittech View Post
just a wild guess, but can your C code send back the socket descriptor to the GUI code, and then let Qt close the socket?

then perhaps you can do something like this:
Qt Code:
  1. int sd = C_CodeFunction();
  2. if(udp->setSocketDescriptor(sd))
  3. {
  4. QObject::connect(udp, SIGNAL(readyRead()), your_obj, SLOT(your_slot()));
  5. }
To copy to clipboard, switch view to plain text mode 

or something to that effect.
wow!!! it worked I can't believe that your suggestion worked. I just passed the socket descriptor from C code to the Qt code and i am now able to read all messages in the Qt code.

Thanks a lot for replying and helping me in this issue

I still have no idea why i was not able to create a new socket and read the messages earlier.